turbo-stream
Advanced tools
Comparing version
@@ -15,3 +15,3 @@ declare const ASYNC_FRAME_TYPE_PROMISE = 1; | ||
plugins?: EncodePlugin[]; | ||
redactErrors?: boolean; | ||
redactErrors?: boolean | string; | ||
signal?: AbortSignal; | ||
@@ -27,3 +27,3 @@ }; | ||
promiseId: number; | ||
}, plugins: EncodePlugin[], redactErrors: boolean): void; | ||
}, plugins: EncodePlugin[], redactErrors: boolean | string): void; | ||
export {}; |
@@ -385,6 +385,10 @@ "use strict"; | ||
function prepareErrorForEncoding(error, redactErrors) { | ||
const shouldRedact = redactErrors === true || | ||
typeof redactErrors === "string" || | ||
typeof redactErrors === "undefined"; | ||
const redacted = typeof redactErrors === "string" ? redactErrors : shared_js_1.STR_REDACTED; | ||
return { | ||
name: redactErrors ? "Error" : error.name, | ||
message: redactErrors ? shared_js_1.STR_REDACTED : error.message, | ||
stack: redactErrors ? shared_js_1.STR_REDACTED : error.stack, | ||
name: shouldRedact ? "Error" : error.name, | ||
message: shouldRedact ? redacted : error.message, | ||
stack: shouldRedact ? undefined : error.stack, | ||
cause: error.cause, | ||
@@ -391,0 +395,0 @@ }; |
{ | ||
"name": "turbo-stream", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "A streaming data transport format that aims to support built-in features such as Promises, Dates, RegExps, Maps, Sets and more.", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
103346
0.41%2782
0.22%