@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.esm.js
CHANGED
|
@@ -40323,8 +40323,7 @@ validatorFns[NO_MORE_THAN_SIX_NUMBERS] = (value) => {
|
|
|
40323
40323
|
* https://stripe.com/en-ca/resources/more/how-to-use-the-luhn-algorithm-a-guide-in-applications-for-businesses#luhn-algorithm-formula
|
|
40324
40324
|
*/
|
|
40325
40325
|
|
|
40326
|
-
function luhnValid(string) {
|
|
40327
|
-
if (!string) {
|
|
40326
|
+
function luhnValid(string) { if (!string) {
|
|
40328
40327
|
return false;
|
|
40329
40328
|
}
|
|
40330
40329
|
|
|
@@ -40376,7 +40375,7 @@ validatorFns[INCLUDES_POTENTIAL_CARD_NUMBER] = (value) => {
|
|
|
40376
40375
|
// A potential credit card number is a sequence of 8 to 20 digits, with optional spaces or hyphens between them
|
|
40377
40376
|
const regexString = '(?:\\d[ -]*){8,20}';
|
|
40378
40377
|
const regex = new RegExp(regexString);
|
|
40379
|
-
return
|
|
40378
|
+
return !(luhnValid(value) && regex.test(value));
|
|
40380
40379
|
};
|
|
40381
40380
|
|
|
40382
40381
|
const NUMBER_LESS_THAN = 'validator/NUMBER_LESS_THAN';
|
|
@@ -49166,7 +49165,7 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
49166
49165
|
};
|
|
49167
49166
|
}
|
|
49168
49167
|
}, []);
|
|
49169
|
-
var nameOnCardErrors = _defineProperty({}, required.error, "Name is required");
|
|
49168
|
+
var nameOnCardErrors = _defineProperty(_defineProperty({}, required.error, "Name is required"), includesPotentialCardNumber.error, "Invalid name");
|
|
49170
49169
|
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"));
|
|
49171
49170
|
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");
|
|
49172
49171
|
var cvvErrors = _defineProperty(_defineProperty({}, required.error, "CVV is required"), hasLength.error, "CVV is invalid");
|