| 5789 | * @since 3.10.0 |
| 5790 | */ |
| 5791 | export class BigIntFromNumber extends transformOrFail( |
| 5792 | Number$.annotations({ description: "a number to be decoded into a bigint" }), |
| 5793 | BigIntFromSelf.pipe(betweenBigInt(BigInt(Number.MIN_SAFE_INTEGER), BigInt(Number.MAX_SAFE_INTEGER))), |
| 5794 | { |
| 5795 | strict: true, |
| 5796 | decode: (i, _, ast) => |
| 5797 | ParseResult.fromOption( |
| 5798 | bigInt_.fromNumber(i), |
| 5799 | () => new ParseResult.Type(ast, i, `Unable to decode ${i} into a bigint`) |
| 5800 | ), |
| 5801 | encode: (a, _, ast) => |
| 5802 | ParseResult.fromOption( |
| 5803 | bigInt_.toNumber(a), |
| 5804 | () => new ParseResult.Type(ast, a, `Unable to encode ${a}n into a number`) |
| 5805 | ) |
| 5806 | } |
| 5807 | ).annotations({ identifier: "BigIntFromNumber" }) {} |
| 5808 | |
| 5809 | const redactedArbitrary = <A>(value: LazyArbitrary<A>): LazyArbitrary<redacted_.Redacted<A>> => (fc) => |
| 5810 | value(fc).map(redacted_.make) |
nothing calls this directly
no test coverage detected
searching dependent graphs…