Download react-hook-form/scripts/rollup/assert-cjs-exports.cjs from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 672 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-hook-form/scripts/rollup/assert-cjs-exports.cjs
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-hook-form/scripts/rollup/assert-cjs-exports.cjs
-
curl -L -o assert-cjs-exports.cjs https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-hook-form/scripts/rollup/assert-cjs-exports.cjs
672 Bytes
| /** | |
| * This file, when executed in the postbuild lifecycle, ensures that | |
| * the CJS output is valid CJS according to the package.json spec. | |
| * | |
| * @see https://nodejs.org/docs/latest/api/packages.html#packages_determining_module_system | |
| */ | |
| /* eslint-disable @typescript-eslint/no-var-requires */ | |
| const exported = require('react-hook-form'); | |
| const assert = require('assert'); | |
| const fs = require('fs'); | |
| /** | |
| * When this fails, fine the update one-liner in ./assert-esm-exports.mjs | |
| */ | |
| const expected = JSON.parse( | |
| fs.readFileSync( | |
| require('path').resolve(__dirname, './all-exports.json'), | |
| 'utf-8', | |
| ), | |
| ); | |
| assert.deepStrictEqual(Object.keys(exported), expected); | |