Skip to content

Variable: creditCard

ts
const creditCard: Validator<string>;

Credit card validation using the Luhn algorithm / 使用 Luhn 算法的信用卡校验

Example

ts
creditCard('4111111111111111') // => { isValid: true, message: undefined }
creditCard('1234567890123456') // => { isValid: false, message: 'Invalid credit card number / 信用卡号格式无效' }

Since

1.0.0

Released under the MIT License.