當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript JSONExt.deepEqual方法代碼示例

本文整理匯總了TypeScript中@phosphor/coreutils.JSONExt.deepEqual方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript JSONExt.deepEqual方法的具體用法?TypeScript JSONExt.deepEqual怎麽用?TypeScript JSONExt.deepEqual使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@phosphor/coreutils.JSONExt的用法示例。


在下文中一共展示了JSONExt.deepEqual方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1:

 isToggled: () => {
   // Only show as toggled if the shortcuts are strictly
   // The Enter ones.
   return linebreak && JSONExt.deepEqual(linebreak.keys, ['Ctrl Enter']) &&
          runUnforced && JSONExt.deepEqual(runUnforced.keys, ['Enter']) &&
          runForced && JSONExt.deepEqual(runForced.keys, ['Shift Enter']);
 },
開發者ID:groutr,項目名稱:jupyterlab,代碼行數:7,代碼來源:index.ts

示例2: it

 it('should return the typeMap', () => {
   let model = new CompleterModel();
   let options = ['foo'];
   let typeMap = { foo: 'instance' };
   model.setOptions(options, typeMap);
   expect(JSONExt.deepEqual(model.typeMap(), typeMap)).to.be.ok();
 });
開發者ID:dalejung,項目名稱:jupyterlab,代碼行數:7,代碼來源:model.spec.ts

示例3: it

 it('should get the value of the object', () => {
   const value = new ObservableValue('value');
   expect(value.get()).to.equal('value');
   const value2 = new ObservableValue({ one: 'one', two: 2 });
   expect(
     JSONExt.deepEqual(value2.get(), { one: 'one', two: 2 })
   ).to.equal(true);
 });
開發者ID:afshin,項目名稱:jupyterlab,代碼行數:8,代碼來源:modeldb.spec.ts

示例4: it

 it('should return the raw JSON values', () => {
   let model = new MimeModel();
   model.data.set('foo', 1);
   model.metadata.set('bar', 'baz');
   expect(JSONExt.deepEqual(model.toJSON(), {
     trusted: false,
     data: {'foo': 1 },
     metadata: {'bar': 'baz'}
   })).to.be(true);
 });
開發者ID:charnpreetsingh185,項目名稱:jupyterlab,代碼行數:10,代碼來源:mimemodel.spec.ts

示例5:

 registry.pluginChanged.connect(async (sender, plugin) => {
   if (plugin !== shortcuts.id) {
     // If the plugin changed its shortcuts, reload everything.
     let oldShortcuts = loaded[plugin];
     let newShortcuts =
       registry.plugins[plugin].schema['jupyter.lab.shortcuts'] || [];
     if (
       oldShortcuts === undefined ||
       !JSONExt.deepEqual(oldShortcuts, newShortcuts)
     ) {
       canonical = null;
       await registry.reload(shortcuts.id);
     }
   }
 });
開發者ID:AlbertHilb,項目名稱:jupyterlab,代碼行數:15,代碼來源:index.ts

示例6: expect

 manager.runningChanged.connect((sender, args) => {
   expect(sender).to.be(manager);
   expect(JSONExt.deepEqual(toArray(args), data)).to.be(true);
   done();
 });
開發者ID:faricacarroll,項目名稱:jupyterlab,代碼行數:5,代碼來源:manager.spec.ts

示例7: it

 it('should get the running sessions', () => {
   let test = JSONExt.deepEqual(toArray(data), toArray(manager.running()));
   expect(test).to.be(true);
 });
開發者ID:faricacarroll,項目名稱:jupyterlab,代碼行數:4,代碼來源:manager.spec.ts

示例8: expect

 }).then((info) => {
   content = info.content;
   expect(JSONExt.deepEqual(content, kernel.info)).to.be(true);
   return kernel.shutdown();
 });
開發者ID:faricacarroll,項目名稱:jupyterlab,代碼行數:5,代碼來源:integration.ts

示例9: it

 it('should compare two JSON values for deep equality', () => {
   expect(JSONExt.deepEqual([], [])).to.equal(true);
   expect(JSONExt.deepEqual([1], [1])).to.equal(true);
   expect(JSONExt.deepEqual({}, {})).to.equal(true);
   expect(JSONExt.deepEqual({a: []}, {a: []})).to.equal(true);
   expect(JSONExt.deepEqual({a: { b: null }}, {a: { b: null }})).to.equal(true);
   expect(JSONExt.deepEqual({a: '1'}, {a: '1'})).to.equal(true);
   expect(JSONExt.deepEqual({a: { b: null }}, {a: { b: '1' }})).to.equal(false);
   expect(JSONExt.deepEqual({a: []}, {a: [1]})).to.equal(false);
   expect(JSONExt.deepEqual([1], [1, 2])).to.equal(false);
   expect(JSONExt.deepEqual(null, [1, 2])).to.equal(false);
   expect(JSONExt.deepEqual([1], {})).to.equal(false);
   expect(JSONExt.deepEqual([1], [2])).to.equal(false);
   expect(JSONExt.deepEqual({}, { a: 1 })).to.equal(false);
   expect(JSONExt.deepEqual({ b: 1 }, { a: 1 })).to.equal(false);
 });
開發者ID:afshin,項目名稱:phosphor,代碼行數:16,代碼來源:json.spec.ts

示例10: expect

 TerminalSession.listRunning().then(models => {
   expect(JSONExt.deepEqual(data, toArray(models))).to.be(true);
   done();
 }).catch(done);
開發者ID:faricacarroll,項目名稱:jupyterlab,代碼行數:4,代碼來源:terminal.spec.ts


注:本文中的@phosphor/coreutils.JSONExt.deepEqual方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。