本文整理汇总了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);