mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 08:02:28 +00:00
10 lines
266 B
TypeScript
10 lines
266 B
TypeScript
export function quoteCliCommandArgument(value: string): string {
|
|
if (/^[a-zA-Z0-9._:/@-]+$/.test(value)) {
|
|
return value
|
|
}
|
|
if (process.platform === 'win32') {
|
|
return `"${value.replace(/"/g, '\\"')}"`
|
|
}
|
|
return `'${value.replaceAll("'", "'\\''")}'`
|
|
}
|