Spaces:
Running
Running
Download node_modules/braces/lib/stringify.js from Chunte/HFBA: direct link, hf CLI and curl.
- Browser
- Download file 700 Bytes
-
https://huggingface.co/spaces/Chunte/HFBA/resolve/refs%2Fpr%2F1/node_modules/braces/lib/stringify.js
- Command line
-
hf download hf://spaces/Chunte/HFBA@refs/pr/1/node_modules/braces/lib/stringify.js
-
curl -L -o stringify.js https://huggingface.co/spaces/Chunte/HFBA/resolve/refs%2Fpr%2F1/node_modules/braces/lib/stringify.js
700 Bytes
| ; | |
| const utils = require('./utils'); | |
| module.exports = (ast, options = {}) => { | |
| let stringify = (node, parent = {}) => { | |
| let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent); | |
| let invalidNode = node.invalid === true && options.escapeInvalid === true; | |
| let output = ''; | |
| if (node.value) { | |
| if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) { | |
| return '\\' + node.value; | |
| } | |
| return node.value; | |
| } | |
| if (node.value) { | |
| return node.value; | |
| } | |
| if (node.nodes) { | |
| for (let child of node.nodes) { | |
| output += stringify(child); | |
| } | |
| } | |
| return output; | |
| }; | |
| return stringify(ast); | |
| }; | |