Skip to content

Commit

Permalink
ignore debug type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gmaclennan committed Nov 21, 2023
1 parent 1133e75 commit 5d7c251
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions src/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,26 @@ createDebug.formatters.k = function (v) {
* @param {import('./sync/sync-state.js').State} v
* @this {any} */
createDebug.formatters.X = function (v) {
const mapped = mapObject(v, (k, v) => [
k,
mapObject(v, (k, v) => {
if (k === 'remoteStates')
return [k, mapObject(v, (k, v) => [k.slice(0, 7), v])]
return [k, v]
}),
])
return util.inspect(mapped, {
colors: true,
depth: 10,
compact: 6,
breakLength: 90,
})
try {
const mapped = mapObject(v, (k, v) => [
k,
// @ts-ignore - type checks here don't get us anything
mapObject(v, (k, v) => {
if (k === 'remoteStates')
// @ts-ignore - type checks here don't get us anything
return [k, mapObject(v, (k, v) => [k.slice(0, 7), v])]
return [k, v]
}),
])
return util.inspect(mapped, {
colors: true,
depth: 10,
compact: 6,
breakLength: 90,
})
} catch (e) {
return `[ERROR: $(e.message)]`
}
}

const counts = new Map()
Expand Down

0 comments on commit 5d7c251

Please sign in to comment.