Download web/client/node_modules/data-urls/lib/utils.js from amitesh11/pose: direct link, hf CLI and curl.
- Browser
- Download file 489 Bytes
-
https://huggingface.co/spaces/amitesh11/pose/resolve/main/web/client/node_modules/data-urls/lib/utils.js
- Command line
-
hf download hf://spaces/amitesh11/pose/web/client/node_modules/data-urls/lib/utils.js
-
curl -L -o utils.js https://huggingface.co/spaces/amitesh11/pose/resolve/main/web/client/node_modules/data-urls/lib/utils.js
489 Bytes
| ; | |
| const { atob } = require("abab"); | |
| exports.stripLeadingAndTrailingASCIIWhitespace = string => { | |
| return string.replace(/^[ \t\n\f\r]+/u, "").replace(/[ \t\n\f\r]+$/u, ""); | |
| }; | |
| exports.isomorphicDecode = input => { | |
| return Array.from(input, byte => String.fromCodePoint(byte)).join(""); | |
| }; | |
| exports.forgivingBase64Decode = data => { | |
| const asString = atob(data); | |
| if (asString === null) { | |
| return null; | |
| } | |
| return Uint8Array.from(asString, c => c.codePointAt(0)); | |
| }; | |