Spaces:
Configuration error
Configuration error
Download sessions/node_modules/decode-named-character-reference/index.js from CPISTO/TARSTHENEXT: direct link, hf CLI and curl.
- Browser
- Download file 634 Bytes
-
https://huggingface.co/spaces/CPISTO/TARSTHENEXT/resolve/main/sessions/node_modules/decode-named-character-reference/index.js
- Command line
-
hf download hf://spaces/CPISTO/TARSTHENEXT/sessions/node_modules/decode-named-character-reference/index.js
-
curl -L -o index.js https://huggingface.co/spaces/CPISTO/TARSTHENEXT/resolve/main/sessions/node_modules/decode-named-character-reference/index.js
634 Bytes
| import {characterEntities} from 'character-entities' | |
| // To do: next major: use `Object.hasOwn`. | |
| const own = {}.hasOwnProperty | |
| /** | |
| * Decode a single character reference (without the `&` or `;`). | |
| * You probably only need this when you’re building parsers yourself that follow | |
| * different rules compared to HTML. | |
| * This is optimized to be tiny in browsers. | |
| * | |
| * @param {string} value | |
| * `notin` (named), `#123` (deci), `#x123` (hexa). | |
| * @returns {string|false} | |
| * Decoded reference. | |
| */ | |
| export function decodeNamedCharacterReference(value) { | |
| return own.call(characterEntities, value) ? characterEntities[value] : false | |
| } | |