valgen 5.13.1 → 5.13.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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # v5.13.2
2
+ [2025-03-15]
3
+
4
+ ### Fixes
5
+
6
+ * fix: Fixed ignoring pipe validators if context.errors has items. ([`0b02ca1`](https://github.com/panates/valgen/commit/0b02ca17762f9512542bc79ad044d1072805f857))
7
+
1
8
  # v5.13.1
2
9
  [2025-03-14]
3
10
 
@@ -15,12 +15,13 @@ function pipe(rules, options) {
15
15
  let c;
16
16
  let v = input;
17
17
  let returnValue = input;
18
+ const oldErrors = context.errors.length;
18
19
  for (i = 0; i < l; i++) {
19
20
  c = rules[i];
20
21
  v = c(v, context);
21
22
  if (returnIndex == null || i <= returnIndex)
22
23
  returnValue = v;
23
- if (context.errors.length)
24
+ if (context.errors.length > oldErrors)
24
25
  return;
25
26
  }
26
27
  return returnValue;
@@ -11,12 +11,13 @@ export function pipe(rules, options) {
11
11
  let c;
12
12
  let v = input;
13
13
  let returnValue = input;
14
+ const oldErrors = context.errors.length;
14
15
  for (i = 0; i < l; i++) {
15
16
  c = rules[i];
16
17
  v = c(v, context);
17
18
  if (returnIndex == null || i <= returnIndex)
18
19
  returnValue = v;
19
- if (context.errors.length)
20
+ if (context.errors.length > oldErrors)
20
21
  return;
21
22
  }
22
23
  return returnValue;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "valgen",
3
3
  "description": "Fast runtime type validator, converter and io (encoding/decoding) library",
4
- "version": "5.13.1",
4
+ "version": "5.13.2",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
7
7
  "dependencies": {