Download .opencode/node_modules/yaml/browser/dist/nodes/identity.js from Chenloong999/opencode-data: direct link, hf CLI and curl.
- Browser
- Download file 1.51 kB
-
https://huggingface.co/datasets/Chenloong999/opencode-data/resolve/main/.opencode/node_modules/yaml/browser/dist/nodes/identity.js
- Command line
-
hf download hf://datasets/Chenloong999/opencode-data/.opencode/node_modules/yaml/browser/dist/nodes/identity.js
-
curl -L -o identity.js https://huggingface.co/datasets/Chenloong999/opencode-data/resolve/main/.opencode/node_modules/yaml/browser/dist/nodes/identity.js
1.51 kB
| const ALIAS = Symbol.for('yaml.alias'); | |
| const DOC = Symbol.for('yaml.document'); | |
| const MAP = Symbol.for('yaml.map'); | |
| const PAIR = Symbol.for('yaml.pair'); | |
| const SCALAR = Symbol.for('yaml.scalar'); | |
| const SEQ = Symbol.for('yaml.seq'); | |
| const NODE_TYPE = Symbol.for('yaml.node.type'); | |
| const isAlias = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === ALIAS; | |
| const isDocument = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === DOC; | |
| const isMap = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === MAP; | |
| const isPair = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === PAIR; | |
| const isScalar = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === SCALAR; | |
| const isSeq = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === SEQ; | |
| function isCollection(node) { | |
| if (node && typeof node === 'object') | |
| switch (node[NODE_TYPE]) { | |
| case MAP: | |
| case SEQ: | |
| return true; | |
| } | |
| return false; | |
| } | |
| function isNode(node) { | |
| if (node && typeof node === 'object') | |
| switch (node[NODE_TYPE]) { | |
| case ALIAS: | |
| case MAP: | |
| case SCALAR: | |
| case SEQ: | |
| return true; | |
| } | |
| return false; | |
| } | |
| const hasAnchor = (node) => (isScalar(node) || isCollection(node)) && !!node.anchor; | |
| export { ALIAS, DOC, MAP, NODE_TYPE, PAIR, SCALAR, SEQ, hasAnchor, isAlias, isCollection, isDocument, isMap, isNode, isPair, isScalar, isSeq }; | |