Download node_modules/fast-check/lib/arbitrary/boolean.js from Really-amin/Datasourceforcryptocurrency: direct link, hf CLI and curl.
- Browser
- Download file 514 Bytes
-
https://huggingface.co/spaces/Really-amin/Datasourceforcryptocurrency/resolve/250b128700538234afd94de5d02f4e054f24823e/node_modules/fast-check/lib/arbitrary/boolean.js
- Command line
-
hf download hf://spaces/Really-amin/Datasourceforcryptocurrency@250b128700538234afd94de5d02f4e054f24823e/node_modules/fast-check/lib/arbitrary/boolean.js
-
curl -L -o boolean.js https://huggingface.co/spaces/Really-amin/Datasourceforcryptocurrency/resolve/250b128700538234afd94de5d02f4e054f24823e/node_modules/fast-check/lib/arbitrary/boolean.js
514 Bytes
| ; | |
| Object.defineProperty(exports, "__esModule", { value: true }); | |
| exports.boolean = boolean; | |
| const integer_1 = require("./integer"); | |
| const noBias_1 = require("./noBias"); | |
| 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 (0, noBias_1.noBias)((0, integer_1.integer)({ min: 0, max: 1 }).map(booleanMapper, booleanUnmapper)); | |
| } | |