mirror of
https://github.com/dorny/paths-filter.git
synced 2025-06-07 16:49:03 +00:00
5 lines
259 B
TypeScript
5 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')
|
|
}
|