本文整理汇总了TypeScript中phosphor/lib/algorithm/iteration.toArray函数的典型用法代码示例。如果您正苦于以下问题:TypeScript toArray函数的具体用法?TypeScript toArray怎么用?TypeScript toArray使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了toArray函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should get a list of user metadata keys', () => {
let model = new CellModel({});
let cursor = model.getMetadata('foo');
expect(toArray(model.listMetadata())).to.be.empty();
cursor.setValue(1);
expect(toArray(model.listMetadata())).to.eql(['foo']);
});
示例2: it
it('should return model options', () => {
let model = new CompleterModel();
let options = ['foo'];
model.setOptions(options);
expect(toArray(model.options())).to.not.equal(options);
expect(toArray(model.options())).to.eql(options);
});
示例3: it
it('should clone the rendermime instance with shallow copies of data', () => {
let r = defaultRenderMime();
let c = r.clone();
expect(toArray(c.mimetypes())).to.eql(toArray(r.mimetypes()));
let t = new TextRenderer();
c.addRenderer('text/foo', t);
expect(r).to.not.be(c);
});
示例4: it
it('should list the metadata namespace keys for the notebook', () => {
let model = new NotebookModel();
let keys = ['kernelspec', 'language_info', 'orig_nbformat'];
expect(toArray(model.listMetadata())).to.eql(keys);
let cursor = model.getMetadata('foo');
expect(toArray(model.listMetadata())).to.eql(keys);
cursor.setValue(1);
keys.push('foo');
expect(toArray(model.listMetadata())).to.eql(keys);
});
示例5: it
it('should handle just a multi-part extension', () => {
registry.addModelFactory(new TextModelFactory());
let factory = new WidgetFactory({
name: 'table',
fileExtensions: ['.table.json'],
});
registry.addWidgetFactory(factory);
let factories = registry.preferredWidgetFactories('.table.json');
expect(toArray(factories)).to.eql([factory]);
factories = registry.preferredWidgetFactories('.json');
expect(toArray(factories)).to.eql([]);
});
示例6: it
it('should get the registered file creators', () => {
expect(toArray(registry.creators()).length).to.be(0);
let creators = [
{ name: 'Python Notebook', fileType: 'notebook' },
{ name: 'R Notebook', fileType: 'notebook' },
{ name: 'CSharp Notebook', fileType: 'notebook' }
];
registry.addCreator(creators[0]);
registry.addCreator(creators[1]);
registry.addCreator(creators[2]);
expect(toArray(registry.creators()).length).to.be(3);
expect(registry.creators().next().name).to.be('CSharp Notebook');
});