Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

276 B
Raw Blame
const SAFE = /^[A-Za-z0-9][A-Za-z0-9_.-]*$/;

export function isShellSafe(value: string): boolean {
  return SAFE.test(value);
}

export function shellSafeOr(value: string | null, fallback: string): string {
  return value !== null && isShellSafe(value) ? value : fallback;
}