Download node_modules/fast-check/lib/esm/arbitrary/boolean.js from Really-amin/Datasourceforcryptocurrency: direct link, hf CLI and curl.
- Browser
- Download file 401 Bytes
-
https://huggingface.co/spaces/Really-amin/Datasourceforcryptocurrency/resolve/250b128700538234afd94de5d02f4e054f24823e/node_modules/fast-check/lib/esm/arbitrary/boolean.js
- Command line
-
hf download hf://spaces/Really-amin/Datasourceforcryptocurrency@250b128700538234afd94de5d02f4e054f24823e/node_modules/fast-check/lib/esm/arbitrary/boolean.js
-
curl -L -o boolean.js https://huggingface.co/spaces/Really-amin/Datasourceforcryptocurrency/resolve/250b128700538234afd94de5d02f4e054f24823e/node_modules/fast-check/lib/esm/arbitrary/boolean.js
401 Bytes
| import { integer } from './integer.js'; | |
| import { noBias } from './noBias.js'; | |
| function booleanMapper(v) { | |
| return v === 1; | |
| } | |
| function booleanUnmapper(v) { | |
| if (typeof v !== 'boolean') | |
| throw new Error('Unsupported input type'); | |
| return v === true ? 1 : 0; | |
| } | |
| function boolean() { | |
| return noBias(integer({ min: 0, max: 1 }).map(booleanMapper, booleanUnmapper)); | |
| } | |
| export { boolean }; | |