Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

171 B
Raw Blame
export function shellEscape(arg: string): string {
  if (arg === '') return "''";
  if (/^[\w.\-/]+$/.test(arg)) return arg;
  return `'${arg.replace(/'/g, "'\\''")}'`;
}