INNER CODE UNIT · TypeScript

recursiveList

open-gitagent/clawless · src/container.ts:727

async function recursiveList(
  wc: WebContainer,
  absDir: string,
  rootDir: string,
): Promise<string[]> {
  const entries = await wc.fs.readdir(absDir, { withFileTypes: true });
  const results: string[] = [];

  for (const entry of entries) {
    if (entry.name === 'node_modules') continue;
    const abs = `${absDir}/${entry.name}`;
    const rel = abs.replace(rootDir + '/', '');

    if (entry.isDirectory()) {
      results.push(rel + '/');
      const children = await recursiveList(wc, abs, rootDir);
      results.push(...children);
    } else {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…