Download .opencode/node_modules/yaml/dist/compose/util-contains-newline.js from Chenloong999/opencode-data: direct link, hf CLI and curl.
- Browser
- Download file 1.08 kB
-
https://huggingface.co/datasets/Chenloong999/opencode-data/resolve/main/.opencode/node_modules/yaml/dist/compose/util-contains-newline.js
- Command line
-
hf download hf://datasets/Chenloong999/opencode-data/.opencode/node_modules/yaml/dist/compose/util-contains-newline.js
-
curl -L -o util-contains-newline.js https://huggingface.co/datasets/Chenloong999/opencode-data/resolve/main/.opencode/node_modules/yaml/dist/compose/util-contains-newline.js
1.08 kB
| ; | |
| function containsNewline(key) { | |
| if (!key) | |
| return null; | |
| switch (key.type) { | |
| case 'alias': | |
| case 'scalar': | |
| case 'double-quoted-scalar': | |
| case 'single-quoted-scalar': | |
| if (key.source.includes('\n')) | |
| return true; | |
| if (key.end) | |
| for (const st of key.end) | |
| if (st.type === 'newline') | |
| return true; | |
| return false; | |
| case 'flow-collection': | |
| for (const it of key.items) { | |
| for (const st of it.start) | |
| if (st.type === 'newline') | |
| return true; | |
| if (it.sep) | |
| for (const st of it.sep) | |
| if (st.type === 'newline') | |
| return true; | |
| if (containsNewline(it.key) || containsNewline(it.value)) | |
| return true; | |
| } | |
| return false; | |
| default: | |
| return true; | |
| } | |
| } | |
| exports.containsNewline = containsNewline; | |