本文整理匯總了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']);
},
示例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();
});
示例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);
});
示例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);
});
示例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);
}
}
});
示例6: expect
manager.runningChanged.connect((sender, args) => {
expect(sender).to.be(manager);
expect(JSONExt.deepEqual(toArray(args), data)).to.be(true);
done();
});
示例7: it
it('should get the running sessions', () => {
let test = JSONExt.deepEqual(toArray(data), toArray(manager.running()));
expect(test).to.be(true);
});
示例8: expect
}).then((info) => {
content = info.content;
expect(JSONExt.deepEqual(content, kernel.info)).to.be(true);
return kernel.shutdown();
});
示例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);
});
示例10: expect
TerminalSession.listRunning().then(models => {
expect(JSONExt.deepEqual(data, toArray(models))).to.be(true);
done();
}).catch(done);