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

Function getRequiredModuleNameFromCall

tools/eslint-rules/required-modules.js:53–60  ·  view source on GitHub ↗

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

(node)

Source from the content-addressed store, hash-verified

51 * @returns {undefined | string} required module name or undefined
52 */
53 function getRequiredModuleNameFromCall(node) {
54 // Node has arguments and first argument is string
55 if (node.arguments.length && isString(node.arguments[0])) {
56 return getRequiredModuleName(node.arguments[0].value.trim());
57 }
58
59 return undefined;
60 }
61
62 const rules = {
63 'Program:exit'(node) {

Callers 1

createFunction · 0.85

Calls 2

getRequiredModuleNameFunction · 0.85
isStringFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…