Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/deep-map.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const { Buffer } = require('node:buffer')
const { serializeError } = require('./error')

const deepMap = (input, handler = v => v, path = ['$'], seen = new Set([input])) => {
Expand All @@ -10,7 +9,7 @@ const deepMap = (input, handler = v => v, path = ['$'], seen = new Set([input]))
return deepMap(serializeError(input), handler, path, seen)
}
// allows for non-node js environments, sush as workers
if (input instanceof Buffer) {
if (typeof Buffer !== 'undefined' && input instanceof Buffer) {
return `[unable to log instanceof buffer]`
}
if (input instanceof Uint8Array) {
Expand Down
Loading