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


TypeScript lodash.flatten函数代码示例

本文整理汇总了TypeScript中lodash.flatten函数的典型用法代码示例。如果您正苦于以下问题:TypeScript flatten函数的具体用法?TypeScript flatten怎么用?TypeScript flatten使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了flatten函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1:

 const topicPhrases = topics.map((topic: TopicCollection) => _.flatten(topic.actions.map(action => action.phrases)));
开发者ID:LexieCore,项目名称:bot-framework,代码行数:1,代码来源:classifier.ts

示例2: flatten

 .then(result => flatten(result));
开发者ID:salihkardan,项目名称:kibana,代码行数:1,代码来源:kibana_metrics_adapter.ts

示例3: expandHistory

export function expandHistory(lexemes: string[]): string[] {
    return _.flatten(lexemes.map(lexeme => historyReplacement(lexeme)));
}
开发者ID:CodeFork,项目名称:black-screen,代码行数:3,代码来源:CommandExpander.ts

示例4: test

test('each chunk has the correct slice size', t => {
    let allLengths = _.flatten(_.map(chunks, chunk => _.map(chunk, 'length')));
    t.deepEqual(allLengths, _.fill(Array(12), 4));
});
开发者ID:PlaytestersKitchen,项目名称:match-three-js,代码行数:4,代码来源:iterchunks.ts

示例5: loadModules

 loadModules(locations: string[]) {
   let activities = _.flatten(locations.map(this.loadLocation.bind(this))) as T[]
   for (let activity of activities) {
     this.registry[activity.getHandlerName()] = activity
   }
 }
开发者ID:instructure,项目名称:ftl-engine,代码行数:6,代码来源:Registry.ts

示例6: return

 return () => curryDefinition(definition, _.flatten(args), spreadIndex, isFixed);
开发者ID:clabough,项目名称:DefinitelyTyped,代码行数:1,代码来源:generate-fp.ts

示例7: expect

 cacheInitializer.refreshCache('credentials').then((result: any[]) => {
   expect(flatten(result)).toEqual(keys.account);
   cache = infrastructureCache.get('credentials');
   expect(cache.keys().length).toBe(0);
 });
开发者ID:brujoand,项目名称:deck,代码行数:5,代码来源:cacheInitializer.service.spec.ts

示例8: getMonikers

 public getMonikers(applications: Application[],  filter: IServerGroupFilter = defaultFilter): IMoniker[] {
   const allMonikers: IMoniker[][] = applications.map(a => a.getDataSource('serverGroups').data
     .filter(filter)
     .map((serverGroup: IServerGroup) => serverGroup.moniker));
   return compact(flatten(allMonikers));
 }
开发者ID:robfletcher,项目名称:deck,代码行数:6,代码来源:listExtractor.service.ts

示例9: getClusters

 public getClusters(applications: Application[], filter: IServerGroupFilter = defaultFilter): string[] {
   const allClusters: string[][] = applications.map(a => a.getDataSource('serverGroups').data
     .filter(filter)
     .map((serverGroup: IServerGroup) => serverGroup.cluster));
   return uniq(compact(flatten(allClusters))).sort();
 }
开发者ID:robfletcher,项目名称:deck,代码行数:6,代码来源:listExtractor.service.ts

示例10: flatten

export const getColorDefinition = (hex: string, theme: GrafanaTheme): ColorDefinition | undefined => {
  return flatten(Array.from(getNamedColorPalette().values())).filter(definition => definition.variants[theme] === hex)[0];
};
开发者ID:gnydick,项目名称:grafana,代码行数:3,代码来源:namedColorsPalette.ts


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