nana 1.1.0 → 1.2.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/CHANGELOG.md +5 -0
- package/dist/cjs/index.cjs +3 -3
- package/dist/esm/index.js +3 -3
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
package/dist/cjs/index.cjs
CHANGED
|
@@ -88,10 +88,10 @@ function createValidator(name, handler) {
|
|
|
88
88
|
function pipe(...validators) {
|
|
89
89
|
return createValidator("pipe", (value, ctx) => {
|
|
90
90
|
for (const validator of validators) {
|
|
91
|
-
if (ctx.
|
|
91
|
+
if (ctx.__abortPipe) break;
|
|
92
92
|
value = validator(value, ctx);
|
|
93
93
|
}
|
|
94
|
-
delete ctx.
|
|
94
|
+
delete ctx.__abortPipe;
|
|
95
95
|
return value;
|
|
96
96
|
})();
|
|
97
97
|
}
|
|
@@ -134,7 +134,7 @@ const required = createValidator("required", (value, ctx, args) => {
|
|
|
134
134
|
});
|
|
135
135
|
const optional = createValidator("optional", (value, ctx, args) => {
|
|
136
136
|
if (value == null) {
|
|
137
|
-
ctx.
|
|
137
|
+
ctx.__abortPipe = true;
|
|
138
138
|
return value;
|
|
139
139
|
}
|
|
140
140
|
return value;
|
package/dist/esm/index.js
CHANGED
|
@@ -51,10 +51,10 @@ function createValidator(name, handler) {
|
|
|
51
51
|
function pipe(...validators) {
|
|
52
52
|
return createValidator("pipe", (value, ctx) => {
|
|
53
53
|
for (const validator of validators) {
|
|
54
|
-
if (ctx.
|
|
54
|
+
if (ctx.__abortPipe) break;
|
|
55
55
|
value = validator(value, ctx);
|
|
56
56
|
}
|
|
57
|
-
delete ctx.
|
|
57
|
+
delete ctx.__abortPipe;
|
|
58
58
|
return value;
|
|
59
59
|
})();
|
|
60
60
|
}
|
|
@@ -97,7 +97,7 @@ const required = createValidator("required", (value, ctx, args) => {
|
|
|
97
97
|
});
|
|
98
98
|
const optional = createValidator("optional", (value, ctx, args) => {
|
|
99
99
|
if (value == null) {
|
|
100
|
-
ctx.
|
|
100
|
+
ctx.__abortPipe = true;
|
|
101
101
|
return value;
|
|
102
102
|
}
|
|
103
103
|
return value;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nana",
|
|
3
3
|
"description": "A minimal validator for any JavaScript environment.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/cjs/index.cjs",
|
|
7
7
|
"module": "dist/esm/index.js",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"valibot"
|
|
44
44
|
],
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@commitlint/cli": "20.
|
|
47
|
-
"@commitlint/config-conventional": "20.
|
|
48
|
-
"eslint": "9.39.
|
|
46
|
+
"@commitlint/cli": "20.2.0",
|
|
47
|
+
"@commitlint/config-conventional": "20.2.0",
|
|
48
|
+
"eslint": "9.39.2",
|
|
49
49
|
"globals": "16.5.0",
|
|
50
50
|
"husky": "9.1.7",
|
|
51
51
|
"jest": "30.2.0",
|