INNER CODE UNIT · TypeScript

stringOption

superagent-ai/grok-cli · src/index.ts:174

function stringOption(value: string | boolean | undefined): string | undefined {
  return typeof value === "string" ? value : undefined;
}

function collect(value: string, prev: string[]): string[] {
  return [...prev, value];
}

function resolveCliSandboxMode(value: string | boolean | undefined): SandboxMode | undefined {
  if (value === true) return "shuru";
  if (value === false) return "off";
  return undefined;
}

function hasExplicitSandboxOption(options: CliOptions): boolean {
  return options.sandbox === true || options.sandbox === false;
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…