MCPcopy Create free account
hub / github.com/nodejs/node / withMeta

Function withMeta

deps/npm/lib/utils/display.js:140–147  ·  view source on GitHub ↗
(handler)

Source from the content-addressed store, hash-verified

138}
139
140const withMeta = (handler) => (level, ...args) => {
141 let meta = {}
142 const last = args.at(-1)
143 if (last && typeof last === 'object' && Object.hasOwn(last, META)) {
144 meta = args.pop()
145 }
146 return handler(level, meta, ...args)
147}
148
149class Display {
150 #logState = {

Callers 1

DisplayClass · 0.85

Calls 3

popMethod · 0.80
handlerFunction · 0.50
atMethod · 0.45

Tested by

no test coverage detected