MCPcopy
hub / github.com/Kong/insomnia / next

Method next

packages/insomnia/src/sync/git/mem-client.ts:64–86  ·  view source on GitHub ↗
(dir: string, toPrint: string)

Source from the content-addressed store, hash-verified

62 baseDir = path.normalize(baseDir);
63
64 const next = async (dir: string, toPrint: string) => {
65 const entry = this._find(dir);
66
67 if (!entry) {
68 return toPrint;
69 }
70
71 const indent = Array.from({ length: (dir.match(/\//g) || []).length }).join('| ');
72
73 if (entry.type === 'dir') {
74 if (entry.path !== baseDir) {
75 toPrint += `${indent}${entry.name}/\n`;
76 }
77
78 for (const name of await this.readdir(dir)) {
79 toPrint = await next(path.join(dir, name), toPrint);
80 }
81 } else {
82 toPrint += `${indent}${entry.name}\n`;
83 }
84
85 return toPrint;
86 };
87
88 console.log(await next(baseDir, ''));
89 }

Callers

nothing calls this directly

Calls 4

_findMethod · 0.95
readdirMethod · 0.95
matchMethod · 0.80
nextFunction · 0.70

Tested by

no test coverage detected