typia
Version:
Superfast runtime validators with only one line
15 lines • 808 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports._isTypeInt64Bigint = void 0;
const _isTypeInt64Bigint = (value) => MINIMUM <= value && value <= MAXIMUM;
exports._isTypeInt64Bigint = _isTypeInt64Bigint;
// Unlike the `number` path, a `bigint` represents both bounds exactly, so this
// is the true inclusive int64 range rather than an exclusive approximation.
//
// The arguments must stay strings. `BigInt(9223372036854775807)` rounds its
// `number` literal to `2 ** 63` before `BigInt` ever sees it, which is the
// defect this helper exists to close; `BigInt("9223372036854775807")` parses
// the digits directly and is exact.
const MINIMUM = -BigInt("9223372036854775808");
const MAXIMUM = BigInt("9223372036854775807");
//# sourceMappingURL=_isTypeInt64Bigint.js.map