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

Function getModuleName

tools/eslint-rules/require-common-first.js:24–30  ·  view source on GitHub ↗

* Function to check if the path is a module and return its name. * @param {string} str The path to check * @returns {string} module name

(str)

Source from the content-addressed store, hash-verified

22 * @returns {string} module name
23 */
24 function getModuleName(str) {
25 if (str.startsWith('../') && str.endsWith('/common/index.mjs')) {
26 return 'common';
27 }
28
29 return path.basename(str);
30 }
31
32 /**
33 * Function to check if a node has an argument that is a module and

Callers 2

getModuleNameFromCallFunction · 0.70
createFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…