@thecb/components 11.1.14-beta.0 → 11.1.14-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js
CHANGED
|
@@ -40331,8 +40331,7 @@ validatorFns[NO_MORE_THAN_SIX_NUMBERS] = (value) => {
|
|
|
40331
40331
|
* https://stripe.com/en-ca/resources/more/how-to-use-the-luhn-algorithm-a-guide-in-applications-for-businesses#luhn-algorithm-formula
|
|
40332
40332
|
*/
|
|
40333
40333
|
|
|
40334
|
-
function luhnValid(string) {
|
|
40335
|
-
if (!string) {
|
|
40334
|
+
function luhnValid(string) { if (!string) {
|
|
40336
40335
|
return false;
|
|
40337
40336
|
}
|
|
40338
40337
|
|
|
@@ -40384,7 +40383,7 @@ validatorFns[INCLUDES_POTENTIAL_CARD_NUMBER] = (value) => {
|
|
|
40384
40383
|
// A potential credit card number is a sequence of 8 to 20 digits, with optional spaces or hyphens between them
|
|
40385
40384
|
const regexString = '(?:\\d[ -]*){8,20}';
|
|
40386
40385
|
const regex = new RegExp(regexString);
|
|
40387
|
-
return
|
|
40386
|
+
return !(luhnValid(value) && regex.test(value));
|
|
40388
40387
|
};
|
|
40389
40388
|
|
|
40390
40389
|
const NUMBER_LESS_THAN = 'validator/NUMBER_LESS_THAN';
|
|
@@ -49174,7 +49173,7 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
49174
49173
|
};
|
|
49175
49174
|
}
|
|
49176
49175
|
}, []);
|
|
49177
|
-
var nameOnCardErrors = _defineProperty({}, required.error, "Name is required");
|
|
49176
|
+
var nameOnCardErrors = _defineProperty(_defineProperty({}, required.error, "Name is required"), includesPotentialCardNumber.error, "Invalid name");
|
|
49178
49177
|
var creditCardNumberErrors = _defineProperty(_defineProperty(_defineProperty({}, required.error, "Credit card number is required"), hasLength.error, "Credit card number is invalid"), matchesRegex.error, "".concat(displayCardBrand(fields.creditCardNumber.rawValue), " cards are not available for payment"));
|
|
49179
49178
|
var expirationDateErrors = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, required.error, "Expiration date is required"), hasLength.error, "Expiration date is invalid"), isValidMonth.error, "Expiration month is invalid"), dateAfterToday.error, "Expiration date is invalid");
|
|
49180
49179
|
var cvvErrors = _defineProperty(_defineProperty({}, required.error, "CVV is required"), hasLength.error, "CVV is invalid");
|