react-code-dataset / next.js /test /development /app-dir /next-after-app-invalid-usage /basic /utils /log.js
Download next.js/test/development/app-dir/next-after-app-invalid-usage/basic/utils/log.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 453 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/app-dir/next-after-app-invalid-usage/basic/utils/log.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/development/app-dir/next-after-app-invalid-usage/basic/utils/log.js
-
curl -L -o log.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/app-dir/next-after-app-invalid-usage/basic/utils/log.js
453 Bytes
| export function cliLog(/** @type {string | Record<string, any>} */ data) { | |
| console.log('<test-log>' + JSON.stringify(data) + '</test-log>') | |
| } | |
| export function readCliLogs(/** @type {string} */ output) { | |
| return output | |
| .split('\n') | |
| .map((line) => { | |
| const match = line.match(/^<test-log>(?<value>.+?)<\/test-log>$/) | |
| if (!match) { | |
| return null | |
| } | |
| return JSON.parse(match.groups.value) | |
| }) | |
| .filter(Boolean) | |
| } | |