@tapjs/error-serdes
Advanced tools
@@ -26,5 +26,3 @@ "use strict"; | ||
| case constants_js_1.kInspectedSymbol: { | ||
| return Symbol.for(error | ||
| .subarray(1 + 'Symbol('.length, error.length - 1) | ||
| .toString()); | ||
| return Symbol.for(error.subarray(1 + 'Symbol('.length, error.length - 1).toString()); | ||
| } | ||
@@ -31,0 +29,0 @@ case constants_js_1.kCustomInspectedObject: { |
@@ -6,7 +6,5 @@ "use strict"; | ||
| const isMessageFail = (m) => { | ||
| return (m.type === 'test:fail' && | ||
| hasDetails(m) && | ||
| 'error' in m.data.details); | ||
| return (m.type === 'test:fail' && hasDetails(m) && 'error' in m.data.details); | ||
| }; | ||
| exports.isMessageFail = isMessageFail; | ||
| //# sourceMappingURL=messages.js.map |
@@ -86,5 +86,3 @@ "use strict"; | ||
| try { | ||
| if (er !== null && | ||
| er !== undefined && | ||
| constants_js_1.kCustomInspect in er) { | ||
| if (er !== null && er !== undefined && constants_js_1.kCustomInspect in er) { | ||
| return Buffer.from(String.fromCharCode(constants_js_1.kCustomInspectedObject) + (0, node_util_1.inspect)(er), 'utf8'); | ||
@@ -96,6 +94,3 @@ } | ||
| const serialized = (0, v8_1.serialize)(er); | ||
| return Buffer.concat([ | ||
| Buffer.from([constants_js_1.kSerializedObject]), | ||
| serialized, | ||
| ]); | ||
| return Buffer.concat([Buffer.from([constants_js_1.kSerializedObject]), serialized]); | ||
| } | ||
@@ -102,0 +97,0 @@ catch { } |
@@ -78,4 +78,3 @@ "use strict"; | ||
| /* c8 ignore start */ | ||
| const ret = chunk === undefined || typeof chunk === 'function' ? | ||
| super.end(chunk) | ||
| const ret = chunk === undefined || typeof chunk === 'function' ? super.end(chunk) | ||
| : typeof encoding === 'function' ? super.end(chunk, encoding) | ||
@@ -82,0 +81,0 @@ : super.end(chunk, encoding, cb); |
@@ -59,4 +59,3 @@ "use strict"; | ||
| let originalError; | ||
| if ((0, messages_js_1.isMessageFail)(item) && | ||
| item.data.details.error !== undefined) { | ||
| if ((0, messages_js_1.isMessageFail)(item) && item.data.details.error !== undefined) { | ||
| originalError = item.data.details.error; | ||
@@ -63,0 +62,0 @@ Object.assign(item.data.details, { |
@@ -23,5 +23,3 @@ // This module is more or less a direct port of the deserialization logic | ||
| case kInspectedSymbol: { | ||
| return Symbol.for(error | ||
| .subarray(1 + 'Symbol('.length, error.length - 1) | ||
| .toString()); | ||
| return Symbol.for(error.subarray(1 + 'Symbol('.length, error.length - 1).toString()); | ||
| } | ||
@@ -28,0 +26,0 @@ case kCustomInspectedObject: { |
| const hasDetails = (m) => !!m.data.details; | ||
| export const isMessageFail = (m) => { | ||
| return (m.type === 'test:fail' && | ||
| hasDetails(m) && | ||
| 'error' in m.data.details); | ||
| return (m.type === 'test:fail' && hasDetails(m) && 'error' in m.data.details); | ||
| }; | ||
| //# sourceMappingURL=messages.js.map |
@@ -83,5 +83,3 @@ // This module is more or less a direct port of the serialization logic | ||
| try { | ||
| if (er !== null && | ||
| er !== undefined && | ||
| kCustomInspect in er) { | ||
| if (er !== null && er !== undefined && kCustomInspect in er) { | ||
| return Buffer.from(String.fromCharCode(kCustomInspectedObject) + inspect(er), 'utf8'); | ||
@@ -93,6 +91,3 @@ } | ||
| const serialized = serialize(er); | ||
| return Buffer.concat([ | ||
| Buffer.from([kSerializedObject]), | ||
| serialized, | ||
| ]); | ||
| return Buffer.concat([Buffer.from([kSerializedObject]), serialized]); | ||
| } | ||
@@ -99,0 +94,0 @@ catch { } |
| import { Minipass } from 'minipass'; | ||
| import { DefaultDeserializer } from 'v8'; | ||
| import { kSerializedSizeHeader, kV8HeaderLength, } from './constants.js'; | ||
| import { kSerializedSizeHeader, kV8HeaderLength } from './constants.js'; | ||
| import { deserializeError } from './deserialize.js'; | ||
@@ -61,4 +61,3 @@ export * from './messages.js'; | ||
| /* c8 ignore start */ | ||
| const ret = chunk === undefined || typeof chunk === 'function' ? | ||
| super.end(chunk) | ||
| const ret = chunk === undefined || typeof chunk === 'function' ? super.end(chunk) | ||
| : typeof encoding === 'function' ? super.end(chunk, encoding) | ||
@@ -65,0 +64,0 @@ : super.end(chunk, encoding, cb); |
| import { Minipass } from 'minipass'; | ||
| import { DefaultSerializer } from 'v8'; | ||
| import { kSerializedSizeHeader, kV8HeaderLength, } from './constants.js'; | ||
| import { kSerializedSizeHeader, kV8HeaderLength } from './constants.js'; | ||
| import { isMessageFail, } from './messages.js'; | ||
@@ -42,4 +42,3 @@ import { serializeError } from './serialize.js'; | ||
| let originalError; | ||
| if (isMessageFail(item) && | ||
| item.data.details.error !== undefined) { | ||
| if (isMessageFail(item) && item.data.details.error !== undefined) { | ||
| originalError = item.data.details.error; | ||
@@ -46,0 +45,0 @@ Object.assign(item.data.details, { |
+1
-1
| { | ||
| "name": "@tapjs/error-serdes", | ||
| "version": "4.0.2", | ||
| "version": "4.0.3", | ||
| "description": "Port of node's error_serdes.js to userland, plus test message streaming", | ||
@@ -5,0 +5,0 @@ "tshy": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
105969
-0.75%1012
-2.13%