mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* 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, ' ');
|
||||
}
|
||||
Reference in New Issue
Block a user