MCPcopy Create free account
hub / github.com/firebase/firebase-tools / loadAllCommands

Function loadAllCommands

src/bin/cli.ts:35–57  ·  view source on GitHub ↗
(client: Record<string, unknown>)

Source from the content-addressed store, hash-verified

33 * into them so the nested subcommands are not skipped.
34 */
35export function loadAllCommands(client: Record<string, unknown>): void {
36 const seen = new Set<unknown>();
37 const loadAll = (obj: Record<string, unknown>) => {
38 if (seen.has(obj)) return;
39 seen.add(obj);
40 for (const [key, value] of Object.entries(obj)) {
41 if (key === "cli") {
42 continue;
43 }
44 if (isCommandModule(value)) {
45 value.load();
46 }
47 if (
48 (typeof value === "object" || typeof value === "function") &&
49 value !== null &&
50 !Array.isArray(value)
51 ) {
52 loadAll(value as Record<string, unknown>);
53 }
54 }
55 };
56 loadAll(client);
57}
58
59export function cli(pkg: any) {
60 const updateNotifier = updateNotifierPkg({ pkg });

Callers 2

cli.spec.tsFile · 0.90
cliFunction · 0.85

Calls 1

loadAllFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…