Skip to content

pakdatakit/class-validator

Type Alias Description
DecoratorOptions Options for the decorators: class-validator’s own options (groups, each, always, context), plus a custom message.
Variable Description
pk class-validator decorators for Pakistani identifiers. They work in NestJS DTOs with the built-in ValidationPipe; no NestJS package is needed. Combine with @IsOptional() for optional fields.
IsCNIC Validates a CNIC. See pk.
IsPakPhone Validates a Pakistani mobile number. See pk.
IsPakIBAN Validates a Pakistani IBAN. Named IsPakIBAN so it does not clash with class-validator’s own IsIBAN. See pk.
IsNTN Validates an NTN. See pk.
IsSTRN Validates an STRN. See pk.
IsPakLandline Validates a Pakistani landline number. See pk.
IsPakPassport Validates the format of a Pakistani passport number. See pk.
IsVehiclePlate Validates the format of a vehicle registration number. See pk.
IsCodPhone Validates a mobile number a courier can call: valid, and with no phoneRiskSignals flag. See pk.
IsPakAmount Validates a rupee amount as people type it (150,000, Rs. 1,50,000/-, 1.5 lakh): one that parseAmount reads. See pk.