Repository URL to install this package:
Version:
0.9.6 ▾
|
declare type CreditCardDataType = string | number;
declare const isAmexCard: any;
/**
* @todo isWesternUnion
*/
declare const masterCard: Readonly<{
owns: string;
cardLength: number;
cvcLength: number;
match: RegExp;
is: any;
icon: string;
}>;
declare const visaCard: Readonly<{
owns: string;
cardLength: number;
cvcLength: number;
match: RegExp;
is: any;
icon: string;
}>;
declare const amexCard: Readonly<{
owns: string;
cardLength: number;
cvcLength: number;
match: RegExp;
is: any;
icon: string;
}>;
declare const discoverCard: Readonly<{
owns: string;
cardLength: number;
cvcLength: number;
is: any;
match: ReadonlyArray<RegExp>;
icon: string;
}>;
declare const dinnerClubCard: Readonly<{
owns: string;
cardLength: number;
cvcLength: number;
match: ReadonlyArray<RegExp>;
is: any;
icon: string;
}>;
declare const invalidCard: Readonly<{
owns: string;
cardLength: number;
cvcLength: number;
match: RegExp;
is: (card: any) => boolean;
icon: string;
}>;
/**
* @param {String} value
* @return {CreditCard}
*/
declare function toCreditCard(value: CreditCardDataType): object;
/**
* @note - this always returns a boolean, to coerce to credit card, use it
* if you benchmark and need perf boost, add cache or safety to `toInvalidCard`
*
* @param {String} value
* @return {Boolean}
*/
declare function isValidCreditCard(value: string): boolean;
declare function isValidSecurityCode(value: CreditCardDataType): boolean;
export { masterCard };
export { visaCard };
export { amexCard };
export { isAmexCard };
export { discoverCard };
export { dinnerClubCard };
export { invalidCard };
export { toCreditCard };
export { isValidCreditCard };
export { isValidSecurityCode };
export default isValidCreditCard;