mirror of
https://github.com/dorny/paths-filter.git
synced 2026-03-19 18:00:21 +00:00
6 lines
259 B
TypeScript
6 lines
259 B
TypeScript
// Uses easy safe set of characters which can be left unescaped to keep it readable.
|
|
// Every other character will be backslash-escaped
|
|
export default function shellEscape(value: string): string {
|
|
return value.replace(/([^a-zA-Z0-9,._+:@%/-])/gm, '\\$1')
|
|
}
|