Spaces:
Sleeping
Sleeping
Download gui/frontend/node_modules/escape-string-regexp/index.js from BrianLov/guiBackend: direct link, hf CLI and curl.
- Browser
- Download file 461 Bytes
-
https://huggingface.co/spaces/BrianLov/guiBackend/resolve/main/gui/frontend/node_modules/escape-string-regexp/index.js
- Command line
-
hf download hf://spaces/BrianLov/guiBackend/gui/frontend/node_modules/escape-string-regexp/index.js
-
curl -L -o index.js https://huggingface.co/spaces/BrianLov/guiBackend/resolve/main/gui/frontend/node_modules/escape-string-regexp/index.js
461 Bytes
| ; | |
| module.exports = string => { | |
| if (typeof string !== 'string') { | |
| throw new TypeError('Expected a string'); | |
| } | |
| // Escape characters with special meaning either inside or outside character sets. | |
| // Use a simple backslash escape when it’s always valid, and a \unnnn escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar. | |
| return string | |
| .replace(/[|\\{}()[\]^$+*?.]/g, '\\$&') | |
| .replace(/-/g, '\\x2d'); | |
| }; | |