Open jonball4 opened 2 years ago
@jonball4 could you please provide a repro?
@gcanti @jonball4 could you please provide a repro?
interface PositiveBigIntBrand {
readonly PositiveBigInt: unique symbol
}
const PositiveBigInt = t.brand(
t.bigint,
(n): n is t.Branded<bigint, PositiveBigIntBrand> => BigInt(0) < n,
'PositiveBigInt',
)
const testC = t.type({ value: PositiveBigInt });
const testValidation = testC.decode({ value: -10n });
// This will throw
const value = PathReporter.report(testValidation);
https://github.com/gcanti/io-ts/blob/920b21ea32e82b328cd14ff4b28da72ae60db505/src/PathReporter.ts#L18
This will throw an error when a
bigint
is involved. Could we use areplacer
in this call to handlebigint
?