| 124 | const lineBreakRegExp = /[\n\r]/; |
| 125 | |
| 126 | const assertNoLineBreak = value => { |
| 127 | if (lineBreakRegExp.test(value)) { |
| 128 | throw new TypeError(`The command and its arguments cannot contain a line break on Windows without a shell.\nThis would allow a command injection with \`cmd.exe\`.\nInvalid value: ${JSON.stringify(`${value}`)}`); |
| 129 | } |
| 130 | }; |
| 131 | |
| 132 | // See https://web.archive.org/web/20241220221102/https://www.robvanderwoude.com/escapechars.php |
| 133 | // eslint-disable-next-line regexp/sort-character-class-elements |
no outgoing calls
no test coverage detected