@nlozgachev/pipelined 0.53.0 → 0.55.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.
@@ -1,8 +1,8 @@
1
- import { M as Maybe, R as Result, T as Task } from './Validation-CvCuj9D2.mjs';
2
- export { E as Equality, a as Err, F as Failed, N as None, O as Ok, b as Ordering, P as Passed, S as Some, V as Validation } from './Validation-CvCuj9D2.mjs';
3
- import { o as WithValue, i as WithLog, D as Deferred, h as WithKind, e as WithError, R as RetryOptions, b as TimeoutOptions, n as WithTimeout, j as WithMinInterval, c as WithCooldown, W as WithConcurrency, m as WithSize, d as WithDuration, k as WithN, g as WithFirst, l as WithSecond } from './InternalTypes-CDiDBAY4.mjs';
4
- import { D as Duration } from './Duration-B8joKzro.mjs';
5
- import './types.mjs';
1
+ import { M as Maybe, R as Result, T as Task } from './Validation-CbU7Z-kj.cjs';
2
+ export { E as Equality, a as Err, F as Failed, N as None, O as Ok, b as Ordering, P as Passed, S as Some, V as Validation } from './Validation-CbU7Z-kj.cjs';
3
+ import { o as WithValue, i as WithLog, D as Deferred, h as WithKind, e as WithError, R as RetryOptions, b as TimeoutOptions, n as WithTimeout, j as WithMinInterval, c as WithCooldown, W as WithConcurrency, m as WithSize, d as WithDuration, k as WithN, g as WithFirst, l as WithSecond } from './InternalTypes-DuK_XpTi.cjs';
4
+ import { D as Duration } from './Duration-B8joKzro.cjs';
5
+ import './types.cjs';
6
6
 
7
7
  /**
8
8
  * A type that can combine two values of type `A` into one, with a neutral starting value.
@@ -2035,7 +2035,7 @@ declare namespace RemoteData {
2035
2035
  * pipe(RemoteData.make.loading<string, number>(), RemoteData.getOrElse(() => null)); // null — typed as number | null
2036
2036
  * ```
2037
2037
  */
2038
- const getOrElse: <E, A, B>(defaultValue: () => B) => (data: RemoteData<E, A>) => A | B;
2038
+ const getOrElse: <B>(defaultValue: () => B) => <E, A>(data: RemoteData<E, A>) => A | B;
2039
2039
  /**
2040
2040
  * Executes a side effect on the success value without changing the RemoteData.
2041
2041
  *
@@ -2067,7 +2067,7 @@ declare namespace RemoteData {
2067
2067
  * Recovers from a Failure state by providing a fallback RemoteData.
2068
2068
  * The fallback can produce a different success type, widening the result to `RemoteData<E, A | B>`.
2069
2069
  */
2070
- const recover: <E, A, B>(fallback: (e: E) => RemoteData<E, B>) => (data: RemoteData<E, A>) => RemoteData<E, A | B>;
2070
+ const recover: <E, B>(fallback: (e: E) => RemoteData<E, B>) => <A>(data: RemoteData<E, A>) => RemoteData<E, A | B>;
2071
2071
  namespace to {
2072
2072
  /**
2073
2073
  * Converts a RemoteData to a Maybe.
@@ -2096,7 +2096,7 @@ declare namespace RemoteData {
2096
2096
  *
2097
2097
  * @example
2098
2098
  * ```ts
2099
- * const result = await Task.Result.tryCatch(fetchUser, { onError: String })();
2099
+ * const result = await Task.Result.tryCatch(() => loadUser(), { onError: String })();
2100
2100
  * setState(RemoteData.from.Result(result)); // Success(user) or Failure(msg)
2101
2101
  * ```
2102
2102
  */
@@ -2147,7 +2147,7 @@ declare namespace RemoteData {
2147
2147
  * ```ts
2148
2148
  * const dbResource = Resource.from.handlers(
2149
2149
  * Task.Result.tryCatch(() => openConnection(config), { onError: (e) => new DbError(e) }),
2150
- * (conn) => Task.from.Promise(() => conn.close())
2150
+ * (conn) => Task.tryCatch(() => conn.close(), { onError: () => {} })
2151
2151
  * );
2152
2152
  *
2153
2153
  * const result = await pipe(
@@ -2170,7 +2170,7 @@ declare namespace Resource {
2170
2170
  * ```ts
2171
2171
  * const fileResource = Resource.from.handlers(
2172
2172
  * Task.Result.tryCatch(() => fs.promises.open("data.csv", "r"), { onError: toFileError }),
2173
- * (handle) => Task.from.Promise(() => handle.close())
2173
+ * (handle) => Task.tryCatch(() => handle.close(), { onError: () => {} })
2174
2174
  * );
2175
2175
  * ```
2176
2176
  */
@@ -2183,8 +2183,8 @@ declare namespace Resource {
2183
2183
  * @example
2184
2184
  * ```ts
2185
2185
  * const timerResource = Resource.from.Task<never, Timer>(
2186
- * Task.from.Promise(() => Promise.resolve(startTimer())),
2187
- * (timer) => Task.from.Promise(() => Promise.resolve(timer.stop()))
2186
+ * Task.tryCatch(() => Promise.resolve(startTimer()), { onError: () => defaultTimer }),
2187
+ * (timer) => Task.tryCatch(() => Promise.resolve(timer.stop()), { onError: () => {} })
2188
2188
  * );
2189
2189
  * ```
2190
2190
  */
package/dist/core.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { M as Maybe, R as Result, T as Task } from './Validation-wDL4nEcO.js';
2
- export { E as Equality, a as Err, F as Failed, N as None, O as Ok, b as Ordering, P as Passed, S as Some, V as Validation } from './Validation-wDL4nEcO.js';
1
+ import { M as Maybe, R as Result, T as Task } from './Validation-CmxZ3V4r.js';
2
+ export { E as Equality, a as Err, F as Failed, N as None, O as Ok, b as Ordering, P as Passed, S as Some, V as Validation } from './Validation-CmxZ3V4r.js';
3
3
  import { o as WithValue, i as WithLog, D as Deferred, h as WithKind, e as WithError, R as RetryOptions, b as TimeoutOptions, n as WithTimeout, j as WithMinInterval, c as WithCooldown, W as WithConcurrency, m as WithSize, d as WithDuration, k as WithN, g as WithFirst, l as WithSecond } from './InternalTypes-LdhLQx3N.js';
4
4
  import { D as Duration } from './Duration-B8joKzro.js';
5
5
  import './types.js';
@@ -2035,7 +2035,7 @@ declare namespace RemoteData {
2035
2035
  * pipe(RemoteData.make.loading<string, number>(), RemoteData.getOrElse(() => null)); // null — typed as number | null
2036
2036
  * ```
2037
2037
  */
2038
- const getOrElse: <E, A, B>(defaultValue: () => B) => (data: RemoteData<E, A>) => A | B;
2038
+ const getOrElse: <B>(defaultValue: () => B) => <E, A>(data: RemoteData<E, A>) => A | B;
2039
2039
  /**
2040
2040
  * Executes a side effect on the success value without changing the RemoteData.
2041
2041
  *
@@ -2067,7 +2067,7 @@ declare namespace RemoteData {
2067
2067
  * Recovers from a Failure state by providing a fallback RemoteData.
2068
2068
  * The fallback can produce a different success type, widening the result to `RemoteData<E, A | B>`.
2069
2069
  */
2070
- const recover: <E, A, B>(fallback: (e: E) => RemoteData<E, B>) => (data: RemoteData<E, A>) => RemoteData<E, A | B>;
2070
+ const recover: <E, B>(fallback: (e: E) => RemoteData<E, B>) => <A>(data: RemoteData<E, A>) => RemoteData<E, A | B>;
2071
2071
  namespace to {
2072
2072
  /**
2073
2073
  * Converts a RemoteData to a Maybe.
@@ -2096,7 +2096,7 @@ declare namespace RemoteData {
2096
2096
  *
2097
2097
  * @example
2098
2098
  * ```ts
2099
- * const result = await Task.Result.tryCatch(fetchUser, { onError: String })();
2099
+ * const result = await Task.Result.tryCatch(() => loadUser(), { onError: String })();
2100
2100
  * setState(RemoteData.from.Result(result)); // Success(user) or Failure(msg)
2101
2101
  * ```
2102
2102
  */
@@ -2147,7 +2147,7 @@ declare namespace RemoteData {
2147
2147
  * ```ts
2148
2148
  * const dbResource = Resource.from.handlers(
2149
2149
  * Task.Result.tryCatch(() => openConnection(config), { onError: (e) => new DbError(e) }),
2150
- * (conn) => Task.from.Promise(() => conn.close())
2150
+ * (conn) => Task.tryCatch(() => conn.close(), { onError: () => {} })
2151
2151
  * );
2152
2152
  *
2153
2153
  * const result = await pipe(
@@ -2170,7 +2170,7 @@ declare namespace Resource {
2170
2170
  * ```ts
2171
2171
  * const fileResource = Resource.from.handlers(
2172
2172
  * Task.Result.tryCatch(() => fs.promises.open("data.csv", "r"), { onError: toFileError }),
2173
- * (handle) => Task.from.Promise(() => handle.close())
2173
+ * (handle) => Task.tryCatch(() => handle.close(), { onError: () => {} })
2174
2174
  * );
2175
2175
  * ```
2176
2176
  */
@@ -2183,8 +2183,8 @@ declare namespace Resource {
2183
2183
  * @example
2184
2184
  * ```ts
2185
2185
  * const timerResource = Resource.from.Task<never, Timer>(
2186
- * Task.from.Promise(() => Promise.resolve(startTimer())),
2187
- * (timer) => Task.from.Promise(() => Promise.resolve(timer.stop()))
2186
+ * Task.tryCatch(() => Promise.resolve(startTimer()), { onError: () => defaultTimer }),
2187
+ * (timer) => Task.tryCatch(() => Promise.resolve(timer.stop()), { onError: () => {} })
2188
2188
  * );
2189
2189
  * ```
2190
2190
  */