@conform-to/yup 0.9.0 → 1.0.0-pre.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.
- package/index.d.ts +2 -2
- package/index.js +2 -0
- package/index.mjs +3 -1
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Constraint, type Submission } from '@conform-to/dom';
|
|
2
2
|
import * as yup from 'yup';
|
|
3
|
-
export declare function getFieldsetConstraint<Source extends yup.AnyObjectSchema>(source: Source):
|
|
3
|
+
export declare function getFieldsetConstraint<Source extends yup.AnyObjectSchema>(source: Source): Record<string, Constraint>;
|
|
4
4
|
export declare function parse<Schema extends yup.AnyObjectSchema>(payload: FormData | URLSearchParams, config: {
|
|
5
5
|
schema: Schema | ((intent: string) => Schema);
|
|
6
6
|
async?: false;
|
package/index.js
CHANGED
|
@@ -70,12 +70,14 @@ function getFieldsetConstraint(source) {
|
|
|
70
70
|
constraint.required = true;
|
|
71
71
|
break;
|
|
72
72
|
case 'min':
|
|
73
|
+
dom.invariant(typeof constraint.min !== 'string', 'min is not a number');
|
|
73
74
|
if (!constraint.min || constraint.min < Number((_test$params6 = _test.params) === null || _test$params6 === void 0 ? void 0 : _test$params6.min)) {
|
|
74
75
|
var _test$params7;
|
|
75
76
|
constraint.min = Number((_test$params7 = _test.params) === null || _test$params7 === void 0 ? void 0 : _test$params7.min);
|
|
76
77
|
}
|
|
77
78
|
break;
|
|
78
79
|
case 'max':
|
|
80
|
+
dom.invariant(typeof constraint.max !== 'string', 'max is not a number');
|
|
79
81
|
if (!constraint.max || constraint.max > Number((_test$params8 = _test.params) === null || _test$params8 === void 0 ? void 0 : _test$params8.max)) {
|
|
80
82
|
var _test$params9;
|
|
81
83
|
constraint.max = Number((_test$params9 = _test.params) === null || _test$params9 === void 0 ? void 0 : _test$params9.max);
|
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parse as parse$1 } from '@conform-to/dom';
|
|
1
|
+
import { invariant, parse as parse$1 } from '@conform-to/dom';
|
|
2
2
|
import * as yup from 'yup';
|
|
3
3
|
|
|
4
4
|
function getFieldsetConstraint(source) {
|
|
@@ -46,12 +46,14 @@ function getFieldsetConstraint(source) {
|
|
|
46
46
|
constraint.required = true;
|
|
47
47
|
break;
|
|
48
48
|
case 'min':
|
|
49
|
+
invariant(typeof constraint.min !== 'string', 'min is not a number');
|
|
49
50
|
if (!constraint.min || constraint.min < Number((_test$params6 = _test.params) === null || _test$params6 === void 0 ? void 0 : _test$params6.min)) {
|
|
50
51
|
var _test$params7;
|
|
51
52
|
constraint.min = Number((_test$params7 = _test.params) === null || _test$params7 === void 0 ? void 0 : _test$params7.min);
|
|
52
53
|
}
|
|
53
54
|
break;
|
|
54
55
|
case 'max':
|
|
56
|
+
invariant(typeof constraint.max !== 'string', 'max is not a number');
|
|
55
57
|
if (!constraint.max || constraint.max > Number((_test$params8 = _test.params) === null || _test$params8 === void 0 ? void 0 : _test$params8.max)) {
|
|
56
58
|
var _test$params9;
|
|
57
59
|
constraint.max = Number((_test$params9 = _test.params) === null || _test$params9 === void 0 ? void 0 : _test$params9.max);
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Conform helpers for integrating with yup",
|
|
4
4
|
"homepage": "https://conform.guide",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "1.0.0-pre.0",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"module": "index.mjs",
|
|
9
9
|
"types": "index.d.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"url": "https://github.com/edmundhung/conform/issues"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@conform-to/dom": "0.
|
|
28
|
+
"@conform-to/dom": "1.0.0-pre.0",
|
|
29
29
|
"yup": ">=0.32.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|