effect 4.0.0-beta.91 → 4.0.0-beta.93
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/Cause.d.ts +3 -1
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js.map +1 -1
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +13 -7
- package/dist/Schema.js.map +1 -1
- package/dist/internal/core.js +1 -1
- package/dist/internal/effect.js +8 -6
- package/dist/internal/effect.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +1 -1
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +1 -1
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.js +2 -2
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +5 -4
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +5 -4
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +29 -4
- package/dist/unstable/http/Url.d.ts.map +1 -1
- package/dist/unstable/http/Url.js +44 -2
- package/dist/unstable/http/Url.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +2 -28
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +4 -46
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +30 -15
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +4 -3
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/package.json +1 -1
- package/src/Cause.ts +3 -1
- package/src/Schema.ts +17 -3
- package/src/internal/core.ts +1 -1
- package/src/internal/effect.ts +14 -6
- package/src/unstable/http/HttpBody.ts +2 -2
- package/src/unstable/http/HttpClient.ts +2 -2
- package/src/unstable/http/HttpClientRequest.ts +8 -7
- package/src/unstable/http/Url.ts +62 -7
- package/src/unstable/http/UrlParams.ts +5 -58
- package/src/unstable/httpapi/HttpApiBuilder.ts +33 -21
- package/src/unstable/observability/OtlpTracer.ts +4 -3
package/dist/internal/core.js
CHANGED
|
@@ -59,7 +59,7 @@ export const StructuralProto = {
|
|
|
59
59
|
const thatKeys = Object.keys(that);
|
|
60
60
|
if (selfKeys.length !== thatKeys.length) return false;
|
|
61
61
|
for (let i = 0; i < selfKeys.length; i++) {
|
|
62
|
-
if (selfKeys[i] !== thatKeys[i]
|
|
62
|
+
if (selfKeys[i] !== thatKeys[i] || !Equal.equals(this[selfKeys[i]], that[selfKeys[i]])) {
|
|
63
63
|
return false;
|
|
64
64
|
}
|
|
65
65
|
}
|
package/dist/internal/effect.js
CHANGED
|
@@ -174,7 +174,7 @@ export const causeSquash = self => {
|
|
|
174
174
|
return new globalThis.Error("Empty cause");
|
|
175
175
|
};
|
|
176
176
|
/** @internal */
|
|
177
|
-
export const causePrettyErrors = self => {
|
|
177
|
+
export const causePrettyErrors = (self, options) => {
|
|
178
178
|
const errors = [];
|
|
179
179
|
const interrupts = [];
|
|
180
180
|
if (self.reasons.length === 0) return errors;
|
|
@@ -185,7 +185,7 @@ export const causePrettyErrors = self => {
|
|
|
185
185
|
interrupts.push(failure);
|
|
186
186
|
continue;
|
|
187
187
|
}
|
|
188
|
-
errors.push(causePrettyError(failure._tag === "Die" ? failure.defect : failure.error, failure.annotations));
|
|
188
|
+
errors.push(causePrettyError(failure._tag === "Die" ? failure.defect : failure.error, failure.annotations, options));
|
|
189
189
|
}
|
|
190
190
|
if (errors.length === 0) {
|
|
191
191
|
const cause = new Error("The fiber was interrupted by:");
|
|
@@ -196,13 +196,13 @@ export const causePrettyErrors = self => {
|
|
|
196
196
|
});
|
|
197
197
|
error.name = "InterruptError";
|
|
198
198
|
error.stack = `${error.name}: ${error.message}`;
|
|
199
|
-
errors.push(causePrettyError(error, interrupts[0].annotations));
|
|
199
|
+
errors.push(causePrettyError(error, interrupts[0].annotations, options));
|
|
200
200
|
}
|
|
201
201
|
setStackTraceLimit(prevStackLimit);
|
|
202
202
|
return errors;
|
|
203
203
|
};
|
|
204
204
|
/** @internal */
|
|
205
|
-
export const causePrettyError = (original, annotations) => {
|
|
205
|
+
export const causePrettyError = (original, annotations, options) => {
|
|
206
206
|
const kind = typeof original;
|
|
207
207
|
let error;
|
|
208
208
|
if (original && kind === "object") {
|
|
@@ -218,6 +218,9 @@ export const causePrettyError = (original, annotations) => {
|
|
|
218
218
|
const stack = `${error.name}: ${error.message}`;
|
|
219
219
|
error.stack = annotations ? addStackAnnotations(stack, annotations) : stack;
|
|
220
220
|
}
|
|
221
|
+
if (options?.includeCauseInStack) {
|
|
222
|
+
error.stack = renderPrettyError(error);
|
|
223
|
+
}
|
|
221
224
|
for (const key of Object.keys(original)) {
|
|
222
225
|
if (!(key in error)) {
|
|
223
226
|
;
|
|
@@ -297,8 +300,7 @@ const currentStackTrace = frame => {
|
|
|
297
300
|
};
|
|
298
301
|
/** @internal */
|
|
299
302
|
export const causePretty = cause => causePrettyErrors(cause).map(renderPrettyError).join("\n");
|
|
300
|
-
|
|
301
|
-
export const renderPrettyError = e => e.cause ? `${e.stack} {\n${renderErrorCause(e.cause, " ")}\n}` : e.stack;
|
|
303
|
+
const renderPrettyError = e => e.cause ? `${e.stack} {\n${renderErrorCause(e.cause, " ")}\n}` : e.stack;
|
|
302
304
|
const renderErrorCause = (cause, prefix) => {
|
|
303
305
|
const lines = cause.stack.split("\n");
|
|
304
306
|
let stack = `${prefix}[cause]: ${lines[0]}`;
|