@stacksjs/env 0.61.19 → 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.
Files changed (2) hide show
  1. package/dist/index.js +26 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10533,7 +10533,7 @@ class ErrorHandler {
10533
10533
  }
10534
10534
  }
10535
10535
  static writeErrorToConsole(err) {
10536
- 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")
10536
+ 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")
10537
10537
  console.error(err);
10538
10538
  process.exit(ExitCode.FatalError);
10539
10539
  console.error(err);
@@ -10747,10 +10747,32 @@ var errAsync = (err) => new ResultAsync(Promise.resolve(new Err(err)));
10747
10747
  var fromPromise = ResultAsync.fromPromise;
10748
10748
  var fromSafePromise = ResultAsync.fromSafePromise;
10749
10749
  var fromAsyncThrowable = ResultAsync.fromThrowable;
10750
- var appendValueToEndOfList = (value) => (list) => [...list, value];
10751
- var combineResultList = (resultList) => resultList.reduce((acc, result) => acc.isOk() ? result.isErr() ? err(result.error) : acc.map(appendValueToEndOfList(result.value)) : acc, ok([]));
10750
+ var combineResultList = (resultList) => {
10751
+ let acc = ok([]);
10752
+ for (const result of resultList) {
10753
+ if (result.isErr()) {
10754
+ acc = err(result.error);
10755
+ break;
10756
+ } else {
10757
+ acc.map((list) => list.push(result.value));
10758
+ }
10759
+ }
10760
+ return acc;
10761
+ };
10752
10762
  var combineResultAsyncList = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultList);
10753
- 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([]));
10763
+ var combineResultListWithAllErrors = (resultList) => {
10764
+ let acc = ok([]);
10765
+ for (const result of resultList) {
10766
+ if (result.isErr() && acc.isErr()) {
10767
+ acc.error.push(result.error);
10768
+ } else if (result.isErr() && acc.isOk()) {
10769
+ acc = err([result.error]);
10770
+ } else if (result.isOk() && acc.isOk()) {
10771
+ acc.value.push(result.value);
10772
+ }
10773
+ }
10774
+ return acc;
10775
+ };
10754
10776
  var combineResultAsyncListWithAllErrors = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultListWithAllErrors);
10755
10777
  var Result;
10756
10778
  (function(Result2) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/env",
3
3
  "type": "module",
4
- "version": "0.61.19",
4
+ "version": "0.61.21",
5
5
  "description": "Stacks env helper methods.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",