Download node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js from BillAnll/my: direct link, hf CLI and curl.
- Browser
- Download file 473 Bytes
-
https://huggingface.co/spaces/BillAnll/my/resolve/main/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js
- Command line
-
hf download hf://spaces/BillAnll/my/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js
-
curl -L -o normalizeURLForProtocolCheck.js https://huggingface.co/spaces/BillAnll/my/resolve/main/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js
473 Bytes
| ; | |
| const urlParserControlCharacters = /[\t\n\r]/g; | |
| /** | |
| * Match WHATWG URL preprocessing before checking a URL's protocol. | |
| * | |
| * @param {string} url | |
| * | |
| * @returns {string} | |
| */ | |
| export default function normalizeURLForProtocolCheck(url) { | |
| if (typeof url !== 'string') { | |
| return url; | |
| } | |
| let start = 0; | |
| while (start < url.length && url.charCodeAt(start) <= 0x20) { | |
| start++; | |
| } | |
| return url.slice(start).replace(urlParserControlCharacters, ''); | |
| } | |