MCPcopy Index your code
hub / github.com/angular/angularfire / searchApps

Function searchApps

src/schematics/setup/prompts.ts:49–73  ·  view source on GitHub ↗
(apps: FirebaseApp[])

Source from the content-addressed store, hash-verified

47 };
48
49export const searchApps = (apps: FirebaseApp[]) =>
50 // eslint-disable-next-line @typescript-eslint/require-await
51 async (_: any, input: string) => {
52 apps.unshift({
53 appId: NEW_OPTION,
54 displayName: '[CREATE NEW APP]',
55 } as any);
56 return fuzzy.filter(input, apps, {
57 extract(el: FirebaseApp) {
58 return el.displayName;
59 }
60 }).map((result) => {
61 let original: FirebaseApp;
62 if (isApp(result)) {
63 original = result;
64 } else {
65 original = result.original;
66 }
67 return {
68 name: original.displayName,
69 title: original.displayName,
70 value: shortAppId(original),
71 };
72 });
73 };
74
75type Prompt = <K extends string, U= unknown>(questions: { name: K, source: (...args) =>
76 Promise<{ value: U }[]>, default?: U | ((o: U[]) => U | Promise<U>), [key: string]: any }) =>

Callers 1

appPromptFunction · 0.85

Calls 2

shortAppIdFunction · 0.90
isAppFunction · 0.85

Tested by

no test coverage detected