Download contracts/lib/openzeppelin-contracts/scripts/generate/format-lines.js from UTSCybeR/nftbench: direct link, hf CLI and curl.
- Browser
- Download file 422 Bytes
-
https://huggingface.co/datasets/UTSCybeR/nftbench/resolve/main/contracts/lib/openzeppelin-contracts/scripts/generate/format-lines.js
- Command line
-
hf download hf://datasets/UTSCybeR/nftbench/contracts/lib/openzeppelin-contracts/scripts/generate/format-lines.js
-
curl -L -o format-lines.js https://huggingface.co/datasets/UTSCybeR/nftbench/resolve/main/contracts/lib/openzeppelin-contracts/scripts/generate/format-lines.js
422 Bytes
| function formatLines(...lines) { | |
| return [...indentEach(0, lines)].join('\n') + '\n'; | |
| } | |
| function* indentEach(indent, lines) { | |
| for (const line of lines) { | |
| if (Array.isArray(line)) { | |
| yield* indentEach(indent + 1, line); | |
| } else { | |
| const padding = ' '.repeat(indent); | |
| yield* line.split('\n').map(subline => (subline === '' ? '' : padding + subline)); | |
| } | |
| } | |
| } | |
| module.exports = formatLines; | |