UNPKG

polish-validators

Version:

A set of validator functions that check common polish numbers.

36 lines (35 loc) 1.58 kB
/** * Validates a credit card number using the Luhn algorithm. The function requires a * 16-digit credit card number. Any dashes or whitespace are ignored. * * @param {string} number - The 16-digit credit card number as a string. * @returns {boolean} `true` if the credit card number is valid; `false` otherwise. */ export declare function isCreditCardNumberValid(number: string): boolean; /** * Validates a credit card number using the Luhn algorithm. The function requires a * 16-digit credit card number. Any dashes or whitespace are ignored. * * @param {string} number - The 16-digit credit card number as a string. * @returns {boolean} `true` if the credit card number is invalid; `false` otherwise. */ export declare const isCreditCardNumberInvalid: (number: string) => boolean; export declare const CreditCardType: { readonly Airline: "airline"; readonly ClubCard: "clubcard"; readonly Visa: "visa"; readonly MasterCard: "mastercard"; readonly Finances: "finances"; readonly Fuel: "fuel"; readonly Telecommunication: "telecommunication"; readonly Other: "other"; }; export type CreditCardType = (typeof CreditCardType)[keyof typeof CreditCardType]; /** * Determines the type of credit card based on the first digit of the card number. * * @param {string} number - The credit card number as a string. * @returns {CreditCardType | null} The credit card type, or `null` if the type cannot * be determined. */ export declare function getCreditCardType(number: string): CreditCardType | null;