MCPcopy Index your code
hub / github.com/nodejs/node / sendInspectorCommand

Function sendInspectorCommand

lib/internal/util/inspector.js:48–63  ·  view source on GitHub ↗
(cb, onError)

Source from the content-addressed store, hash-verified

46
47let session;
48function sendInspectorCommand(cb, onError) {
49 const { hasInspector } = internalBinding('config');
50 if (!hasInspector) return onError();
51 // Do not preview when the permission model is enabled
52 // because this feature require access to the inspector,
53 // which is unavailable in this case.
54 if (permission.isEnabled()) return onError();
55 const inspector = require('inspector');
56 if (session === undefined) session = new inspector.Session();
57 session.connect();
58 try {
59 return cb(session);
60 } finally {
61 session.disconnect();
62 }
63}
64
65function isInspectorMessage(string) {
66 return isUsingInspector() && RegExpPrototypeExec(kInspectMsgRegex, string) !== null;

Callers 3

createContextMethod · 0.85
getInputPreviewFunction · 0.85

Calls 6

isEnabledMethod · 0.80
connectMethod · 0.65
disconnectMethod · 0.65
onErrorFunction · 0.50
requireFunction · 0.50
cbFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…