Aller au contenu principal

isBigIntConstraint()

isBigIntConstraint(schema): schema is BigIntConstraint

Type guard for BigIntConstraint. Checks that the schema is a bigint type and has constraint methods.


Parameters​

schema: GenericSchema​

The schema to check


Returns: schema is BigIntConstraint​

True if the schema is a BigIntConstraint with constraint methods


Since​

2.0.0


Example​

const schema = bigint().min(0n);
if (isBigIntConstraint(schema)) {
// schema is narrowed to BigIntConstraint
schema.max(100n); // constraint methods available
}