Download src/js/util/escapeString.js from merve/git-101: direct link, hf CLI and curl.
- Browser
- Download file 251 Bytes
-
https://huggingface.co/spaces/merve/git-101/resolve/main/src/js/util/escapeString.js
- Command line
-
hf download hf://spaces/merve/git-101/src/js/util/escapeString.js
-
curl -L -o escapeString.js https://huggingface.co/spaces/merve/git-101/resolve/main/src/js/util/escapeString.js
251 Bytes
| var mapping = { | |
| '&': '&', | |
| '<': '<', | |
| '>': '>', | |
| '"': '"', | |
| "'": ''', | |
| '/': '/' | |
| }; | |
| module.exports = function(string) { | |
| return ('' + string).replace(/[&<>"'\/]/g, function(match) { | |
| return mapping[match]; | |
| }); | |
| }; | |