@stacksjs/validation 0.61.20 → 0.61.21

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/dist/index.js CHANGED
@@ -18836,7 +18836,7 @@ class ErrorHandler {
18836
18836
  }
18837
18837
  }
18838
18838
  static writeErrorToConsole(err) {
18839
- if (err === "Failed to execute command: bunx biome check --apply ." || err === "Failed to execute command: bun --bun storage/framework/core/actions/src/lint/fix.ts")
18839
+ if (err === "Failed to execute command: bunx biome check --fix" || err === "Failed to execute command: bun --bun storage/framework/core/actions/src/lint/fix.ts")
18840
18840
  console.error(err);
18841
18841
  process.exit(ExitCode.FatalError);
18842
18842
  console.error(err);
@@ -19050,10 +19050,32 @@ var errAsync = (err) => new ResultAsync(Promise.resolve(new Err(err)));
19050
19050
  var fromPromise = ResultAsync.fromPromise;
19051
19051
  var fromSafePromise = ResultAsync.fromSafePromise;
19052
19052
  var fromAsyncThrowable = ResultAsync.fromThrowable;
19053
- var appendValueToEndOfList = (value) => (list) => [...list, value];
19054
- var combineResultList = (resultList) => resultList.reduce((acc, result) => acc.isOk() ? result.isErr() ? err(result.error) : acc.map(appendValueToEndOfList(result.value)) : acc, ok([]));
19053
+ var combineResultList = (resultList) => {
19054
+ let acc = ok([]);
19055
+ for (const result of resultList) {
19056
+ if (result.isErr()) {
19057
+ acc = err(result.error);
19058
+ break;
19059
+ } else {
19060
+ acc.map((list) => list.push(result.value));
19061
+ }
19062
+ }
19063
+ return acc;
19064
+ };
19055
19065
  var combineResultAsyncList = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultList);
19056
- var combineResultListWithAllErrors = (resultList) => resultList.reduce((acc, result) => result.isErr() ? acc.isErr() ? err([...acc.error, result.error]) : err([result.error]) : acc.isErr() ? acc : ok([...acc.value, result.value]), ok([]));
19066
+ var combineResultListWithAllErrors = (resultList) => {
19067
+ let acc = ok([]);
19068
+ for (const result of resultList) {
19069
+ if (result.isErr() && acc.isErr()) {
19070
+ acc.error.push(result.error);
19071
+ } else if (result.isErr() && acc.isOk()) {
19072
+ acc = err([result.error]);
19073
+ } else if (result.isOk() && acc.isOk()) {
19074
+ acc.value.push(result.value);
19075
+ }
19076
+ }
19077
+ return acc;
19078
+ };
19057
19079
  var combineResultAsyncListWithAllErrors = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultListWithAllErrors);
19058
19080
  var Result;
19059
19081
  (function(Result2) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/validation",
3
3
  "type": "module",
4
- "version": "0.61.20",
4
+ "version": "0.61.21",
5
5
  "description": "The Stacks Validation ways.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -50,12 +50,12 @@
50
50
  "peerDependencies": {
51
51
  "@stacksjs/strings": "latest",
52
52
  "@stacksjs/types": "latest",
53
- "@vinejs/vine": "^2.0.0"
53
+ "@vinejs/vine": "^2.1.0"
54
54
  },
55
55
  "dependencies": {
56
56
  "@stacksjs/strings": "latest",
57
57
  "@stacksjs/types": "latest",
58
- "@vinejs/vine": "^2.0.0"
58
+ "@vinejs/vine": "^2.1.0"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@stacksjs/development": "latest"
package/src/validator.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { log } from '@stacksjs/cli'
2
2
  import { path } from '@stacksjs/path'
3
+ import { Model } from '@stacksjs/types'
3
4
  import { SimpleMessagesProvider, VineError, reportError, schema } from '@stacksjs/validation'
4
5
  import type { SchemaTypes } from '@vinejs/vine/types'
5
6