mirror of
https://github.com/wu736139669/hapi.git
synced 2026-10-07 19:06:11 +00:00
11 lines
329 B
TypeScript
11 lines
329 B
TypeScript
/**
|
|
* Strip newlines when passing args through Windows cmd.exe.
|
|
* cmd.exe treats CR/LF as command separators and truncates multiline args.
|
|
*/
|
|
export function stripNewlinesForWindowsShellArg(value: string): string {
|
|
if (process.platform !== 'win32') {
|
|
return value;
|
|
}
|
|
return value.replace(/\r?\n/g, ' ');
|
|
}
|