degachejs
Version:
A Tunisian utility library for working with CIN, phone numbers, addresses, and more
37 lines (36 loc) • 1.27 kB
TypeScript
/**
* Options for car plate validation
*/
export interface CarPlateValidationOptions {
/**
* When true, enforces strict format validation:
* - Spaces must be exactly as expected
* - No extra characters allowed
* - Must use the exact Arabic text "تونس"
*/
strict?: boolean;
/**
* Type of car plate to validate
* - 'standard': Regular car plates (e.g., 123 تونس 4567)
* - 'special': Special car plates (e.g., RS 123 تونس)
* - 'any': Any valid car plate format (default)
*/
type?: "standard" | "special" | "any";
}
/**
* Validates a Tunisian car plate
* @param carPlate - The car plate to validate
* @param options - Validation options
* @returns boolean indicating if the car plate is valid
*/
export declare const validateCarPlate: (carPlate: string, options?: CarPlateValidationOptions) => boolean;
/**
* Gets information about a car plate
* @param carPlate - The car plate to check
* @param options - Validation options
* @returns object with plate type and components, or null if invalid
*/
export declare const getCarPlateInfo: (carPlate: string, options?: CarPlateValidationOptions) => {
type: "standard" | "special";
components: Record<string, string>;
} | null;