redux-freeform 6.2.0 → 6.2.1-beta.0
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.
|
@@ -150,8 +150,7 @@ validatorFns[NO_MORE_THAN_SIX_NUMBERS] = (value) => {
|
|
|
150
150
|
* https://stripe.com/en-ca/resources/more/how-to-use-the-luhn-algorithm-a-guide-in-applications-for-businesses#luhn-algorithm-formula
|
|
151
151
|
*/
|
|
152
152
|
|
|
153
|
-
function luhnValid(string) {
|
|
154
|
-
if (!string) {
|
|
153
|
+
function luhnValid(string) { if (!string) {
|
|
155
154
|
return false;
|
|
156
155
|
}
|
|
157
156
|
|
|
@@ -203,7 +202,7 @@ validatorFns[INCLUDES_POTENTIAL_CARD_NUMBER] = (value) => {
|
|
|
203
202
|
// A potential credit card number is a sequence of 8 to 20 digits, with optional spaces or hyphens between them
|
|
204
203
|
const regexString = '(?:\\d[ -]*){8,20}';
|
|
205
204
|
const regex = new RegExp(regexString);
|
|
206
|
-
return
|
|
205
|
+
return !(luhnValid(value) && regex.test(value));
|
|
207
206
|
};
|
|
208
207
|
|
|
209
208
|
const NUMBER_LESS_THAN = 'validator/NUMBER_LESS_THAN';
|
|
@@ -146,8 +146,7 @@ validatorFns[NO_MORE_THAN_SIX_NUMBERS] = (value) => {
|
|
|
146
146
|
* https://stripe.com/en-ca/resources/more/how-to-use-the-luhn-algorithm-a-guide-in-applications-for-businesses#luhn-algorithm-formula
|
|
147
147
|
*/
|
|
148
148
|
|
|
149
|
-
function luhnValid(string) {
|
|
150
|
-
if (!string) {
|
|
149
|
+
function luhnValid(string) { if (!string) {
|
|
151
150
|
return false;
|
|
152
151
|
}
|
|
153
152
|
|
|
@@ -199,7 +198,7 @@ validatorFns[INCLUDES_POTENTIAL_CARD_NUMBER] = (value) => {
|
|
|
199
198
|
// A potential credit card number is a sequence of 8 to 20 digits, with optional spaces or hyphens between them
|
|
200
199
|
const regexString = '(?:\\d[ -]*){8,20}';
|
|
201
200
|
const regex = new RegExp(regexString);
|
|
202
|
-
return
|
|
201
|
+
return !(luhnValid(value) && regex.test(value));
|
|
203
202
|
};
|
|
204
203
|
|
|
205
204
|
const NUMBER_LESS_THAN = 'validator/NUMBER_LESS_THAN';
|
|
@@ -152,8 +152,7 @@
|
|
|
152
152
|
* https://stripe.com/en-ca/resources/more/how-to-use-the-luhn-algorithm-a-guide-in-applications-for-businesses#luhn-algorithm-formula
|
|
153
153
|
*/
|
|
154
154
|
|
|
155
|
-
function luhnValid(string) {
|
|
156
|
-
if (!string) {
|
|
155
|
+
function luhnValid(string) { if (!string) {
|
|
157
156
|
return false;
|
|
158
157
|
}
|
|
159
158
|
|
|
@@ -205,7 +204,7 @@
|
|
|
205
204
|
// A potential credit card number is a sequence of 8 to 20 digits, with optional spaces or hyphens between them
|
|
206
205
|
const regexString = '(?:\\d[ -]*){8,20}';
|
|
207
206
|
const regex = new RegExp(regexString);
|
|
208
|
-
return
|
|
207
|
+
return !(luhnValid(value) && regex.test(value));
|
|
209
208
|
};
|
|
210
209
|
|
|
211
210
|
const NUMBER_LESS_THAN = 'validator/NUMBER_LESS_THAN';
|
package/package.json
CHANGED