INNER CODE UNIT · TypeScript

requested

rit3zh/reacticx · cloudflare/codebase/index.ts:79

    const requested = (raw ?? "").split(",").map((part) => part.trim()).filter(Boolean);
    const unknown = requested.filter((id) => !sourceIds.includes(id as SourceId));

    if (requested.length === 0) throw new Error(`--only needs a value: ${sourceIds.join(", ")}`);
    if (unknown.length > 0) {
      throw new Error(`unknown source ${unknown.join(", ")} — expected ${sourceIds.join(", ")}`);
    }
    only = requested as SourceId[];
  }

  return {
    dry: has("--dry", "--dry-run", "-n"),
    force: has("--force", "-f"),
    check: has("--check"),
    prune: has("--prune"),
    verify: has("--verify"),
    help: has("--help", "-h"),
    only,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…