当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript iteration.toArray函数代码示例

本文整理汇总了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']);
 });
开发者ID:Carreau,项目名称:jupyterlab,代码行数:7,代码来源:model.spec.ts

示例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);
 });
开发者ID:roshancvp,项目名称:jupyterlab,代码行数:7,代码来源:model.spec.ts

示例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);
 });
开发者ID:danielballan,项目名称:jupyterlab,代码行数:8,代码来源:rendermime.spec.ts

示例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);
 });
开发者ID:roshancvp,项目名称:jupyterlab,代码行数:10,代码来源:model.spec.ts

示例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([]);
 });
开发者ID:Carreau,项目名称:jupyterlab,代码行数:12,代码来源:registry.spec.ts

示例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');
 });
开发者ID:danielballan,项目名称:jupyterlab,代码行数:13,代码来源:registry.spec.ts


注:本文中的phosphor/lib/algorithm/iteration.toArray函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。