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