retuple 1.0.0-next.21 → 1.0.0-next.22

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.cjs CHANGED
@@ -792,6 +792,13 @@ class ResultAsync {
792
792
  return res;
793
793
  }));
794
794
  }
795
+ /**
796
+ * The same as {@link Retuple.$flatten|$flatten} except it returns
797
+ * {@link ResultAsync}.
798
+ */
799
+ $flatten() {
800
+ return new ResultAsync(__classPrivateFieldGet(this, _ResultAsync_inner, "f").then((res) => res.$flatten()));
801
+ }
795
802
  /**
796
803
  * The same as {@link Retuple.$promise|$promise}.
797
804
  */
package/dist/index.d.cts CHANGED
@@ -311,6 +311,11 @@ declare class ResultAsync<T, E> {
311
311
  * - returns {@link ResultAsync}.
312
312
  */
313
313
  $tapErr(this: ResultAsync<T, E>, f: (err: E) => any): ResultAsync<T, E>;
314
+ /**
315
+ * The same as {@link Retuple.$flatten|$flatten} except it returns
316
+ * {@link ResultAsync}.
317
+ */
318
+ $flatten<U, F>(this: ResultAsync<Result<U, F>, E>): ResultAsync<U, E | F>;
314
319
  /**
315
320
  * The same as {@link Retuple.$promise|$promise}.
316
321
  */
package/dist/index.d.ts CHANGED
@@ -311,6 +311,11 @@ declare class ResultAsync<T, E> {
311
311
  * - returns {@link ResultAsync}.
312
312
  */
313
313
  $tapErr(this: ResultAsync<T, E>, f: (err: E) => any): ResultAsync<T, E>;
314
+ /**
315
+ * The same as {@link Retuple.$flatten|$flatten} except it returns
316
+ * {@link ResultAsync}.
317
+ */
318
+ $flatten<U, F>(this: ResultAsync<Result<U, F>, E>): ResultAsync<U, E | F>;
314
319
  /**
315
320
  * The same as {@link Retuple.$promise|$promise}.
316
321
  */
package/dist/index.js CHANGED
@@ -781,6 +781,13 @@ class ResultAsync {
781
781
  return res;
782
782
  }));
783
783
  }
784
+ /**
785
+ * The same as {@link Retuple.$flatten|$flatten} except it returns
786
+ * {@link ResultAsync}.
787
+ */
788
+ $flatten() {
789
+ return new ResultAsync(__classPrivateFieldGet(this, _ResultAsync_inner, "f").then((res) => res.$flatten()));
790
+ }
784
791
  /**
785
792
  * The same as {@link Retuple.$promise|$promise}.
786
793
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "retuple",
3
- "version": "1.0.0-next.21",
3
+ "version": "1.0.0-next.22",
4
4
  "scripts": {
5
5
  "test": "vitest",
6
6
  "lint": "eslint . --ext .ts -c eslint.config.mjs --fix",