redux-freeform 6.0.0 → 6.1.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.
@@ -110,6 +110,25 @@ const onlyExpirationDate = createValidator(
110
110
  validatorFns[ONLY_EXPIRATION_DATE] = (value, args, form) =>
111
111
  /^(\d?\d?\/?\d?\d?)?$/.test(value);
112
112
 
113
+ /*
114
+ 11/24 - Users have been adding full CC numbers to the name field
115
+ This validator will check if the value has more than 6 numeric characters
116
+ We have to allow for some numeric characters to account for business
117
+ names that include numbers like "3M Company" or "Smith Street Trust 40389"
118
+ */
119
+ const NO_MORE_THAN_SIX_NUMBERS = 'validator/NO_MORE_THAN_SIX_NUMBERS';
120
+ const NO_MORE_THAN_SIX_NUMBERS_ERROR = 'error/NO_MORE_THAN_SIX_NUMBERS';
121
+ createValidator(
122
+ NO_MORE_THAN_SIX_NUMBERS,
123
+ NO_MORE_THAN_SIX_NUMBERS_ERROR
124
+ );
125
+ validatorFns[NO_MORE_THAN_SIX_NUMBERS] = (value) => {
126
+ if (value === '') {
127
+ return true;
128
+ }
129
+ return !/(\d.*){7,}/.test(value);
130
+ };
131
+
113
132
  const NUMBER_LESS_THAN = 'validator/NUMBER_LESS_THAN';
114
133
  const NUMBER_LESS_THAN_ERROR = 'error/NUMBER_LESS_THAN';
115
134
  const numberLessThan = createValidator(
@@ -106,6 +106,25 @@ const onlyExpirationDate = createValidator(
106
106
  validatorFns[ONLY_EXPIRATION_DATE] = (value, args, form) =>
107
107
  /^(\d?\d?\/?\d?\d?)?$/.test(value);
108
108
 
109
+ /*
110
+ 11/24 - Users have been adding full CC numbers to the name field
111
+ This validator will check if the value has more than 6 numeric characters
112
+ We have to allow for some numeric characters to account for business
113
+ names that include numbers like "3M Company" or "Smith Street Trust 40389"
114
+ */
115
+ const NO_MORE_THAN_SIX_NUMBERS = 'validator/NO_MORE_THAN_SIX_NUMBERS';
116
+ const NO_MORE_THAN_SIX_NUMBERS_ERROR = 'error/NO_MORE_THAN_SIX_NUMBERS';
117
+ createValidator(
118
+ NO_MORE_THAN_SIX_NUMBERS,
119
+ NO_MORE_THAN_SIX_NUMBERS_ERROR
120
+ );
121
+ validatorFns[NO_MORE_THAN_SIX_NUMBERS] = (value) => {
122
+ if (value === '') {
123
+ return true;
124
+ }
125
+ return !/(\d.*){7,}/.test(value);
126
+ };
127
+
109
128
  const NUMBER_LESS_THAN = 'validator/NUMBER_LESS_THAN';
110
129
  const NUMBER_LESS_THAN_ERROR = 'error/NUMBER_LESS_THAN';
111
130
  const numberLessThan = createValidator(
@@ -112,6 +112,25 @@
112
112
  validatorFns[ONLY_EXPIRATION_DATE] = (value, args, form) =>
113
113
  /^(\d?\d?\/?\d?\d?)?$/.test(value);
114
114
 
115
+ /*
116
+ 11/24 - Users have been adding full CC numbers to the name field
117
+ This validator will check if the value has more than 6 numeric characters
118
+ We have to allow for some numeric characters to account for business
119
+ names that include numbers like "3M Company" or "Smith Street Trust 40389"
120
+ */
121
+ const NO_MORE_THAN_SIX_NUMBERS = 'validator/NO_MORE_THAN_SIX_NUMBERS';
122
+ const NO_MORE_THAN_SIX_NUMBERS_ERROR = 'error/NO_MORE_THAN_SIX_NUMBERS';
123
+ createValidator(
124
+ NO_MORE_THAN_SIX_NUMBERS,
125
+ NO_MORE_THAN_SIX_NUMBERS_ERROR
126
+ );
127
+ validatorFns[NO_MORE_THAN_SIX_NUMBERS] = (value) => {
128
+ if (value === '') {
129
+ return true;
130
+ }
131
+ return !/(\d.*){7,}/.test(value);
132
+ };
133
+
115
134
  const NUMBER_LESS_THAN = 'validator/NUMBER_LESS_THAN';
116
135
  const NUMBER_LESS_THAN_ERROR = 'error/NUMBER_LESS_THAN';
117
136
  const numberLessThan = createValidator(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "redux-freeform",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "description": "A small Redux form library that supports purely functional apps, without magic",
5
5
  "main": "dist/redux-freeform.cjs.js",
6
6
  "module": "dist/redux-freeform.esm.js",
@@ -11,11 +11,11 @@
11
11
  "scripts": {
12
12
  "dev": "rollup -c -w",
13
13
  "build": "rollup -c",
14
- "test": "nyc ava",
14
+ "test": "jest",
15
15
  "format": "prettier --write \"{src,examples,website,test}/**/*.js\" && eslint ./ --ext .js,.jsx,.ts,.tsx --fix",
16
16
  "format-check": "prettier --check \"{src,examples,website,test}/**/*.js\"",
17
17
  "lint": "eslint ./ --ext .js,.jsx,.ts,.tsx",
18
- "coverage": "nyc --reporter=lcov --reporter=text ava && nyc check-coverage --per-file=true"
18
+ "coverage": "jest --coverage --coverageReporters=lcov --coverageReporters=text --coveragePerFile=true"
19
19
  },
20
20
  "dependencies": {
21
21
  "acorn": "^8.8.2",
@@ -29,11 +29,10 @@
29
29
  "@babel/preset-env": "^7.21.5",
30
30
  "@babel/preset-react": "^7.18.6",
31
31
  "@babel/register": "^7.21.0",
32
+ "@fast-check/jest": "^2.0.3",
33
+ "@jest/globals": "^29.7.0",
32
34
  "@rollup/plugin-commonjs": "^24.1.0",
33
35
  "@rollup/plugin-node-resolve": "^15.0.2",
34
- "ava": "^3.15.0",
35
- "ava-fast-check": "^4.0.2",
36
- "babel-plugin-istanbul": "^6.1.1",
37
36
  "coveralls": "^3.1.0",
38
37
  "eslint": "^8.39.0",
39
38
  "eslint-config-prettier": "^8.8.0",
@@ -41,8 +40,7 @@
41
40
  "eslint-plugin-prettier": "^4.2.1",
42
41
  "eslint-plugin-react": "^7.32.2",
43
42
  "esm": "^3.2.25",
44
- "fast-check": "^2.25.0",
45
- "nyc": "^15.1.0",
43
+ "jest": "^29.7.0",
46
44
  "prettier": "^2.8.8",
47
45
  "prettier-eslint": "^15.0.1",
48
46
  "rollup": "2.79.1"