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

Function getModuleNameFromCall

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

* Function to check if a node has an argument that is a module and * return its name. * @param {ASTNode} node The node to check * @returns {undefined | string} module name or undefined

(node)

Source from the content-addressed store, hash-verified

36 * @returns {undefined | string} module name or undefined
37 */
38 function getModuleNameFromCall(node) {
39 // Node has arguments and first argument is string
40 if (node.arguments.length && isString(node.arguments[0])) {
41 return getModuleName(node.arguments[0].value.trim());
42 }
43
44 return undefined;
45 }
46
47 const rules = {
48 'Program:exit'(node) {

Callers 1

createFunction · 0.85

Calls 2

getModuleNameFunction · 0.70
isStringFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…