effect 4.0.0-beta.83 → 4.0.0-beta.85
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/Array.d.ts +64 -64
- package/dist/Array.js +26 -26
- package/dist/Cache.d.ts +1 -1
- package/dist/Cache.js +1 -1
- package/dist/Cause.d.ts +68 -68
- package/dist/Cause.js +47 -47
- package/dist/Channel.d.ts +5 -5
- package/dist/Channel.js +3 -3
- package/dist/Clock.d.ts +1 -1
- package/dist/Clock.js +1 -1
- package/dist/Combiner.d.ts +9 -9
- package/dist/Combiner.js +8 -8
- package/dist/Config.d.ts +15 -94
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +22 -70
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +58 -74
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +66 -41
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +1 -1
- package/dist/Console.js +1 -1
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +4 -3
- package/dist/Context.js.map +1 -1
- package/dist/Data.d.ts +15 -15
- package/dist/Data.js +3 -3
- package/dist/DateTime.d.ts +6 -6
- package/dist/DateTime.js +2 -2
- package/dist/Duration.d.ts +3 -3
- package/dist/Duration.js +3 -3
- package/dist/Effect.d.ts +84 -45
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +72 -33
- package/dist/Effect.js.map +1 -1
- package/dist/Equal.d.ts +7 -7
- package/dist/Equal.js +5 -5
- package/dist/Equivalence.d.ts +17 -17
- package/dist/Equivalence.js +13 -13
- package/dist/Exit.d.ts +3 -3
- package/dist/Exit.js +3 -3
- package/dist/Formatter.d.ts +5 -5
- package/dist/Formatter.js +4 -4
- package/dist/Function.d.ts +10 -10
- package/dist/Function.js +3 -3
- package/dist/HashMap.d.ts +3 -3
- package/dist/HashMap.js +1 -1
- package/dist/Iterable.d.ts +6 -6
- package/dist/Iterable.js +2 -2
- package/dist/JsonPatch.d.ts +2 -2
- package/dist/Layer.d.ts +1 -1
- package/dist/Layer.js +5 -4
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +4 -3
- package/dist/LayerMap.js.map +1 -1
- package/dist/Logger.d.ts +1 -1
- package/dist/Logger.js +1 -1
- package/dist/Match.d.ts +8 -8
- package/dist/Match.js +8 -8
- package/dist/Metric.d.ts +3 -3
- package/dist/Metric.js +3 -3
- package/dist/Optic.d.ts +30 -30
- package/dist/Optic.js +12 -12
- package/dist/Option.d.ts +7 -7
- package/dist/Option.js +7 -7
- package/dist/Order.d.ts +23 -23
- package/dist/Order.js +20 -20
- package/dist/Pool.d.ts +1 -1
- package/dist/Pool.js +1 -1
- package/dist/Predicate.d.ts +88 -88
- package/dist/Predicate.js +47 -47
- package/dist/PubSub.d.ts +3 -3
- package/dist/PubSub.js +3 -3
- package/dist/Random.d.ts +31 -0
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +32 -0
- package/dist/Random.js.map +1 -1
- package/dist/Reducer.d.ts +1 -1
- package/dist/Reducer.js +1 -1
- package/dist/Result.d.ts +18 -18
- package/dist/Result.js +8 -8
- package/dist/Runtime.d.ts +1 -1
- package/dist/Runtime.js +1 -1
- package/dist/Schema.d.ts +313 -126
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +316 -127
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +9 -8
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +203 -140
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +48 -48
- package/dist/SchemaGetter.js +44 -44
- package/dist/SchemaIssue.d.ts +3 -3
- package/dist/SchemaIssue.js +3 -3
- package/dist/SchemaParser.d.ts +122 -22
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +186 -50
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +1 -1
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +96 -2
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +20 -20
- package/dist/SchemaTransformation.js +18 -18
- package/dist/Stream.d.ts +3 -3
- package/dist/Stream.js +2 -2
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +1 -1
- package/dist/String.js +1 -1
- package/dist/Struct.d.ts +1 -1
- package/dist/Struct.js +1 -1
- package/dist/Types.d.ts +13 -13
- package/dist/internal/effect.js +33 -20
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/schema/arbitrary.js +17 -1
- package/dist/internal/schema/arbitrary.js.map +1 -1
- package/dist/internal/schema/cause.d.ts +2 -0
- package/dist/internal/schema/cause.d.ts.map +1 -0
- package/dist/internal/schema/cause.js +24 -0
- package/dist/internal/schema/cause.js.map +1 -0
- package/dist/internal/schema/schema.d.ts +8 -4
- package/dist/internal/schema/schema.d.ts.map +1 -1
- package/dist/internal/schema/schema.js +21 -8
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/internal/stackTraceLimit.d.ts +2 -0
- package/dist/internal/stackTraceLimit.d.ts.map +1 -0
- package/dist/internal/stackTraceLimit.js +40 -0
- package/dist/internal/stackTraceLimit.js.map +1 -0
- package/dist/internal/tracer.d.ts.map +1 -1
- package/dist/internal/tracer.js +4 -3
- package/dist/internal/tracer.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +3 -3
- package/dist/testing/TestSchema.js +1 -1
- package/dist/unstable/ai/AiError.d.ts +1 -1
- package/dist/unstable/ai/AiError.js +1 -1
- package/dist/unstable/ai/Chat.d.ts +1 -1
- package/dist/unstable/ai/Chat.js +1 -1
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +4 -5
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/cli/Prompt.js +2 -2
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +4 -3
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +2 -2
- package/dist/unstable/persistence/PersistedQueue.js +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +1 -1
- package/dist/unstable/rpc/Rpc.js +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js +3 -4
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +4 -3
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
- package/dist/unstable/sql/SqlResolver.js +15 -2
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +1 -0
- package/dist/unstable/workflow/Activity.d.ts.map +1 -1
- package/dist/unstable/workflow/Activity.js +1 -0
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +65 -65
- package/src/Cache.ts +1 -1
- package/src/Cause.ts +68 -68
- package/src/Channel.ts +5 -5
- package/src/Clock.ts +1 -1
- package/src/Combiner.ts +9 -9
- package/src/Config.ts +40 -108
- package/src/ConfigProvider.ts +139 -100
- package/src/Console.ts +1 -1
- package/src/Context.ts +4 -5
- package/src/Data.ts +15 -15
- package/src/DateTime.ts +6 -6
- package/src/Duration.ts +3 -3
- package/src/Effect.ts +89 -45
- package/src/Equal.ts +7 -7
- package/src/Equivalence.ts +17 -17
- package/src/Exit.ts +3 -3
- package/src/Formatter.ts +5 -5
- package/src/Function.ts +10 -10
- package/src/HashMap.ts +3 -3
- package/src/Iterable.ts +6 -6
- package/src/JsonPatch.ts +2 -2
- package/src/Layer.ts +5 -5
- package/src/LayerMap.ts +4 -3
- package/src/Logger.ts +1 -1
- package/src/Match.ts +8 -8
- package/src/Metric.ts +3 -3
- package/src/Optic.ts +30 -30
- package/src/Option.ts +7 -7
- package/src/Order.ts +23 -23
- package/src/Pool.ts +1 -1
- package/src/Predicate.ts +88 -88
- package/src/PubSub.ts +3 -3
- package/src/Random.ts +42 -0
- package/src/Reducer.ts +1 -1
- package/src/Result.ts +20 -20
- package/src/Runtime.ts +1 -1
- package/src/Schema.ts +389 -153
- package/src/SchemaAST.ts +237 -148
- package/src/SchemaGetter.ts +48 -48
- package/src/SchemaIssue.ts +3 -3
- package/src/SchemaParser.ts +197 -58
- package/src/SchemaRepresentation.ts +73 -3
- package/src/SchemaTransformation.ts +20 -20
- package/src/Stream.ts +4 -4
- package/src/String.ts +1 -1
- package/src/Struct.ts +1 -1
- package/src/Types.ts +13 -13
- package/src/internal/effect.ts +40 -21
- package/src/internal/schema/arbitrary.ts +23 -2
- package/src/internal/schema/cause.ts +26 -0
- package/src/internal/schema/schema.ts +36 -10
- package/src/internal/stackTraceLimit.ts +63 -0
- package/src/internal/tracer.ts +4 -3
- package/src/testing/TestSchema.ts +3 -3
- package/src/unstable/ai/AiError.ts +1 -1
- package/src/unstable/ai/Chat.ts +1 -1
- package/src/unstable/ai/Tool.ts +4 -3
- package/src/unstable/cli/Prompt.ts +1 -1
- package/src/unstable/httpapi/HttpApiMiddleware.ts +4 -3
- package/src/unstable/httpapi/HttpApiScalar.ts +2 -2
- package/src/unstable/persistence/PersistedQueue.ts +1 -1
- package/src/unstable/rpc/Rpc.ts +1 -1
- package/src/unstable/rpc/RpcGroup.ts +3 -4
- package/src/unstable/rpc/RpcMiddleware.ts +4 -3
- package/src/unstable/sql/SqlResolver.ts +15 -2
- package/src/unstable/workflow/Activity.ts +2 -0
- package/src/unstable/workflow/WorkflowEngine.ts +1 -1
package/dist/Types.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ type TupleOf_<T, N extends number, R extends Array<unknown>> = `${N}` extends `-
|
|
|
27
27
|
* - If `N` is the general `number` type (non-literal), degrades to `Array<T>`.
|
|
28
28
|
* - Negative numbers produce `never`.
|
|
29
29
|
*
|
|
30
|
-
* **Example** (
|
|
30
|
+
* **Example** (Checking fixed-length tuples)
|
|
31
31
|
*
|
|
32
32
|
* ```ts
|
|
33
33
|
* import type { Types } from "effect"
|
|
@@ -61,7 +61,7 @@ export type TupleOf<N extends number, T> = N extends N ? number extends N ? Arra
|
|
|
61
61
|
*
|
|
62
62
|
* Produces a tuple with `N` fixed positions followed by `...Array<T>`.
|
|
63
63
|
*
|
|
64
|
-
* **Example** (
|
|
64
|
+
* **Example** (Checking minimum-length tuples)
|
|
65
65
|
*
|
|
66
66
|
* ```ts
|
|
67
67
|
* import type { Types } from "effect"
|
|
@@ -198,7 +198,7 @@ export type ExtractTag<E, K extends string> = E extends {
|
|
|
198
198
|
* - If the union members are incompatible (e.g. `string | number`), the
|
|
199
199
|
* result is `never`.
|
|
200
200
|
*
|
|
201
|
-
* **Example** (
|
|
201
|
+
* **Example** (Converting a union to an intersection)
|
|
202
202
|
*
|
|
203
203
|
* ```ts
|
|
204
204
|
* import type { Types } from "effect"
|
|
@@ -258,7 +258,7 @@ export type Simplify<A> = {
|
|
|
258
258
|
* distinguishing between `any`, `unknown`, `never`, and other types.
|
|
259
259
|
* - Resolves to `true` if `X` and `Y` are identical, `false` otherwise.
|
|
260
260
|
*
|
|
261
|
-
* **Example** (
|
|
261
|
+
* **Example** (Checking type equality)
|
|
262
262
|
*
|
|
263
263
|
* ```ts
|
|
264
264
|
* import type { Types } from "effect"
|
|
@@ -285,7 +285,7 @@ export type Equals<X, Y> = (<T>() => T extends X ? 1 : 2) extends <T>() => T ext
|
|
|
285
285
|
*
|
|
286
286
|
* Returns `Y` when `A` and `B` are equal, `N` otherwise.
|
|
287
287
|
*
|
|
288
|
-
* **Example** (
|
|
288
|
+
* **Example** (Choosing a conditional type based on equality)
|
|
289
289
|
*
|
|
290
290
|
* ```ts
|
|
291
291
|
* import type { Types } from "effect"
|
|
@@ -313,7 +313,7 @@ export type EqualsWith<A, B, Y, N> = (<T>() => T extends A ? 1 : 2) extends (<T>
|
|
|
313
313
|
* Returns `true` if at least one key from `Key` exists in `A`, `false`
|
|
314
314
|
* otherwise.
|
|
315
315
|
*
|
|
316
|
-
* **Example** (
|
|
316
|
+
* **Example** (Checking key presence)
|
|
317
317
|
*
|
|
318
318
|
* ```ts
|
|
319
319
|
* import type { Types } from "effect"
|
|
@@ -338,7 +338,7 @@ export type Has<A, Key extends string> = (Key extends infer K ? K extends keyof
|
|
|
338
338
|
*
|
|
339
339
|
* Implemented as `MergeRight<Target, Source>`.
|
|
340
340
|
*
|
|
341
|
-
* **Example** (
|
|
341
|
+
* **Example** (Merging with left bias)
|
|
342
342
|
*
|
|
343
343
|
* ```ts
|
|
344
344
|
* import type { Types } from "effect"
|
|
@@ -404,7 +404,7 @@ export type MergeRight<Target, Source> = Simplify<Source & {
|
|
|
404
404
|
* - `"unbounded"` — run all effects concurrently with no limit.
|
|
405
405
|
* - `"inherit"` — inherit the concurrency from the surrounding context.
|
|
406
406
|
*
|
|
407
|
-
* **Example** (
|
|
407
|
+
* **Example** (Setting concurrency values)
|
|
408
408
|
*
|
|
409
409
|
* ```ts
|
|
410
410
|
* import type { Types } from "effect"
|
|
@@ -431,7 +431,7 @@ export type Concurrency = number | "unbounded" | "inherit";
|
|
|
431
431
|
*
|
|
432
432
|
* Only affects the top level; nested properties remain readonly.
|
|
433
433
|
*
|
|
434
|
-
* **Example** (
|
|
434
|
+
* **Example** (Converting shallowly to mutable types)
|
|
435
435
|
*
|
|
436
436
|
* ```ts
|
|
437
437
|
* import type { Types } from "effect"
|
|
@@ -471,7 +471,7 @@ export type Mutable<T> = {
|
|
|
471
471
|
* Recursion stops at primitives (`string`, `number`, `boolean`, `bigint`,
|
|
472
472
|
* `symbol`) and functions.
|
|
473
473
|
*
|
|
474
|
-
* **Example** (
|
|
474
|
+
* **Example** (Converting deeply to mutable types)
|
|
475
475
|
*
|
|
476
476
|
* ```ts
|
|
477
477
|
* import type { Types } from "effect"
|
|
@@ -533,7 +533,7 @@ export type NoInfer<A> = [A][A extends any ? 0 : never];
|
|
|
533
533
|
* A value of type `Invariant<A>` cannot be assigned to `Invariant<B>` unless
|
|
534
534
|
* `A` and `B` are the same type.
|
|
535
535
|
*
|
|
536
|
-
* **Example** (
|
|
536
|
+
* **Example** (Defining an invariant phantom type)
|
|
537
537
|
*
|
|
538
538
|
* ```ts
|
|
539
539
|
* import type { Types } from "effect"
|
|
@@ -599,7 +599,7 @@ export declare namespace Invariant {
|
|
|
599
599
|
* `Covariant<A>` is assignable to `Covariant<B>` when `A extends B`, following
|
|
600
600
|
* the subtype direction.
|
|
601
601
|
*
|
|
602
|
-
* **Example** (
|
|
602
|
+
* **Example** (Defining a covariant phantom type)
|
|
603
603
|
*
|
|
604
604
|
* ```ts
|
|
605
605
|
* import type { Types } from "effect"
|
|
@@ -665,7 +665,7 @@ export declare namespace Covariant {
|
|
|
665
665
|
* `Contravariant<A>` is assignable to `Contravariant<B>` when `B extends A`,
|
|
666
666
|
* following the supertype direction.
|
|
667
667
|
*
|
|
668
|
-
* **Example** (
|
|
668
|
+
* **Example** (Defining a contravariant phantom type)
|
|
669
669
|
*
|
|
670
670
|
* ```ts
|
|
671
671
|
* import type { Types } from "effect"
|
package/dist/internal/effect.js
CHANGED
|
@@ -21,6 +21,7 @@ import { args, causeAnnotate, causeEmpty, causeFromReasons, CauseImpl, constEmpt
|
|
|
21
21
|
import * as doNotation from "./doNotation.js";
|
|
22
22
|
import * as InternalMetric from "./metric.js";
|
|
23
23
|
import { CurrentConcurrency, CurrentErrorReporters, CurrentLogAnnotations, CurrentLogLevel, CurrentLogSpans, CurrentStackFrame, MinimumLogLevel, TracerEnabled, TracerSpanAnnotations, TracerSpanLinks, TracerTimingEnabled } from "./references.js";
|
|
24
|
+
import { getStackTraceLimit, setStackTraceLimit } from "./stackTraceLimit.js";
|
|
24
25
|
import { addSpanStackTrace, makeStackCleaner } from "./tracer.js";
|
|
25
26
|
import { version } from "./version.js";
|
|
26
27
|
// ----------------------------------------------------------------------------
|
|
@@ -177,8 +178,8 @@ export const causePrettyErrors = self => {
|
|
|
177
178
|
const errors = [];
|
|
178
179
|
const interrupts = [];
|
|
179
180
|
if (self.reasons.length === 0) return errors;
|
|
180
|
-
const prevStackLimit =
|
|
181
|
-
|
|
181
|
+
const prevStackLimit = getStackTraceLimit();
|
|
182
|
+
setStackTraceLimit(1);
|
|
182
183
|
for (const failure of self.reasons) {
|
|
183
184
|
if (failure._tag === "Interrupt") {
|
|
184
185
|
interrupts.push(failure);
|
|
@@ -197,8 +198,7 @@ export const causePrettyErrors = self => {
|
|
|
197
198
|
error.stack = `${error.name}: ${error.message}`;
|
|
198
199
|
errors.push(causePrettyError(error, interrupts[0].annotations));
|
|
199
200
|
}
|
|
200
|
-
;
|
|
201
|
-
Error.stackTraceLimit = prevStackLimit;
|
|
201
|
+
setStackTraceLimit(prevStackLimit);
|
|
202
202
|
return errors;
|
|
203
203
|
};
|
|
204
204
|
/** @internal */
|
|
@@ -667,6 +667,8 @@ export const succeedSome = a => succeed(Option.some(a));
|
|
|
667
667
|
/** @internal */
|
|
668
668
|
export const succeedNone = /*#__PURE__*/succeed(/*#__PURE__*/Option.none());
|
|
669
669
|
/** @internal */
|
|
670
|
+
export const transposeOption = self => Option.isNone(self) ? succeedNone : map(self.value, Option.some);
|
|
671
|
+
/** @internal */
|
|
670
672
|
export const failCauseSync = evaluate => suspend(() => failCause(internalCall(evaluate)));
|
|
671
673
|
/** @internal */
|
|
672
674
|
export const die = defect => exitDie(defect);
|
|
@@ -677,13 +679,17 @@ const void_ = /*#__PURE__*/succeed(void 0);
|
|
|
677
679
|
/** @internal */
|
|
678
680
|
export { void_ as void };
|
|
679
681
|
/** @internal */
|
|
680
|
-
const try_ = options =>
|
|
681
|
-
try
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
})
|
|
682
|
+
const try_ = options => {
|
|
683
|
+
const evaluate = typeof options === "function" ? options : options.try;
|
|
684
|
+
const catcher = typeof options === "function" ? cause => new UnknownError(cause, "An error occurred in Effect.try") : options.catch;
|
|
685
|
+
return suspend(() => {
|
|
686
|
+
try {
|
|
687
|
+
return succeed(internalCall(evaluate));
|
|
688
|
+
} catch (err) {
|
|
689
|
+
return fail(internalCall(() => catcher(err)));
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
};
|
|
687
693
|
/** @internal */
|
|
688
694
|
export { try_ as try };
|
|
689
695
|
/** @internal */
|
|
@@ -695,12 +701,19 @@ export const tryPromise = options => {
|
|
|
695
701
|
const f = typeof options === "function" ? options : options.try;
|
|
696
702
|
const catcher = typeof options === "function" ? cause => new UnknownError(cause, "An error occurred in Effect.tryPromise") : options.catch;
|
|
697
703
|
return callbackOptions(function (resume, signal) {
|
|
704
|
+
const failWithCatch = cause => {
|
|
705
|
+
try {
|
|
706
|
+
resume(fail(internalCall(() => catcher(cause))));
|
|
707
|
+
} catch (err) {
|
|
708
|
+
resume(die(err));
|
|
709
|
+
}
|
|
710
|
+
};
|
|
698
711
|
try {
|
|
699
|
-
internalCall(() => f(signal)).then(a => resume(succeed(a)),
|
|
712
|
+
internalCall(() => f(signal)).then(a => resume(succeed(a)), failWithCatch);
|
|
700
713
|
} catch (err) {
|
|
701
|
-
|
|
714
|
+
failWithCatch(err);
|
|
702
715
|
}
|
|
703
|
-
},
|
|
716
|
+
}, f.length !== 0);
|
|
704
717
|
};
|
|
705
718
|
/** @internal */
|
|
706
719
|
export const withFiberId = f => withFiber(fiber => f(fiber.id));
|
|
@@ -782,10 +795,10 @@ export const fn = function () {
|
|
|
782
795
|
const nameFirst = typeof arguments[0] === "string";
|
|
783
796
|
const name = nameFirst ? arguments[0] : "Effect.fn";
|
|
784
797
|
const spanOptions = nameFirst ? arguments[1] : undefined;
|
|
785
|
-
const prevLimit =
|
|
786
|
-
|
|
798
|
+
const prevLimit = getStackTraceLimit();
|
|
799
|
+
setStackTraceLimit(2);
|
|
787
800
|
const defError = new globalThis.Error();
|
|
788
|
-
|
|
801
|
+
setStackTraceLimit(prevLimit);
|
|
789
802
|
if (nameFirst) {
|
|
790
803
|
return (body, ...pipeables) => makeFn(name, body, defError, pipeables, nameFirst, spanOptions);
|
|
791
804
|
}
|
|
@@ -804,10 +817,10 @@ const makeFn = (name, bodyOrOptions, defError, pipeables, addSpan, spanOptions)
|
|
|
804
817
|
if (!isEffect(result)) {
|
|
805
818
|
return result;
|
|
806
819
|
}
|
|
807
|
-
const prevLimit =
|
|
808
|
-
|
|
820
|
+
const prevLimit = getStackTraceLimit();
|
|
821
|
+
setStackTraceLimit(2);
|
|
809
822
|
const callError = new globalThis.Error();
|
|
810
|
-
|
|
823
|
+
setStackTraceLimit(prevLimit);
|
|
811
824
|
return updateService(addSpan ? useSpan(name, spanOptions, span => provideParentSpan(result, span)) : result, CurrentStackFrame, prev => ({
|
|
812
825
|
name,
|
|
813
826
|
stack: fnStackCleaner(() => callError.stack),
|