UNPKG

regex-friendly

Version:

Readable regex transformations, validations, and utilities with both static and chainable API.

31 lines (30 loc) 1.01 kB
/** Regex function helpers */ export declare const rexFunctions: { /** * Formats a credit card number with spaces for display * @param cardNumber - Credit card number as string * @returns formatted card number * @example * formatCardNumber("4532015112830366"); // "4532 0151 1283 0366" */ formatCardNumber: (cardNumber: string) => string; /** * Validates a credit card number and returns detailed results * @param cardNumber - Credit card number as string * @returns validation result object * @example * validateCreditCard("4111111111111111"); * // { * // isValid: true, * // cardType: "Visa", * // errors: [] * // } * validateCreditCard("1234567890123456"); * // { * // isValid: false, * // cardType: "Unknown", * // errors: ["Invalid card number (failed Luhn check)"] * // } */ validateCreditCard: (cardNumber: string) => import("./utils").ValidationResult; };