當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。