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

Function formatScripts

lib/internal/debugger/inspect_repl.js:418–432  ·  view source on GitHub ↗
(displayNatives = false)

Source from the content-addressed store, hash-verified

416 }
417
418 function formatScripts(displayNatives = false) {
419 function isVisible(script) {
420 if (displayNatives) return true;
421 return !script.isNative || isCurrentScript(script);
422 }
423
424 return ArrayPrototypeJoin(ArrayPrototypeMap(
425 ArrayPrototypeFilter(ObjectValues(knownScripts), isVisible),
426 (script) => {
427 const isCurrent = isCurrentScript(script);
428 const { isNative, url } = script;
429 const name = `${getRelativePath(url)}${isNative ? ' <native>' : ''}`;
430 return `${isCurrent ? '*' : ' '} ${script.scriptId}: ${name}`;
431 }), '\n');
432 }
433
434 function listScripts(displayNatives = false) {
435 print(formatScripts(displayNatives));

Callers 2

listScriptsFunction · 0.85
createReplFunction · 0.85

Calls 2

isCurrentScriptFunction · 0.85
getRelativePathFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…