Closed
Description
const StackUtils = require('stack-utils');
const stack = new StackUtils();
const cleaned = stack.clean(`
at ChannelWrap.emitInitNative (internal/async_hooks.js:136:43)
at new Resolver (internal/dns/utils.js:23:20)
at internal/dns/utils.js:101:23
at NativeModule.compile (internal/bootstrap/loaders.js:285:5)
at nativeModuleRequire (internal/bootstrap/loaders.js:192:14)
at dns.js:38:5
at NativeModule.compile (internal/bootstrap/loaders.js:285:5)
at NativeModule.compileForPublicLoader (internal/bootstrap/loaders.js:220:8)
at loadNativeModule (internal/modules/cjs/helpers.js:23:9)
at Function.Module._load (internal/modules/cjs/loader.js:694:15)
at processTicksAndRejections (node:internal/process/task_queues:93:5)
`);
console.log(cleaned);
Expected result:
''
Received result:
processTicksAndRejections (node:internal/process/task_queues:93:5)
Workaround:
const stack = new StackUtils({
internals: StackUtils.nodeInternals().concat(/\s*\(node:/);
});
Metadata
Metadata
Assignees
Labels
No labels