MCPcopy Index your code
hub / github.com/ilearnio/module-alias / addPath

Function addPath

index.js:78–98  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

76}
77
78function addPath (path) {
79 var parent
80 path = nodePath.normalize(path)
81
82 if (modulePaths.indexOf(path) === -1) {
83 modulePaths.push(path)
84 // Enable the search path for the current top-level module
85 var mainModule = getMainModule()
86 if (mainModule) {
87 addPathHelper(path, mainModule.paths)
88 }
89 parent = module.parent
90
91 // Also modify the paths of the module that was used to load the
92 // app-module-paths module and all of it's parents
93 while (parent && parent !== mainModule) {
94 addPathHelper(path, parent.paths)
95 parent = parent.parent
96 }
97 }
98}
99
100function addAliases (aliases) {
101 for (var alias in aliases) {

Callers 1

initFunction · 0.85

Calls 2

getMainModuleFunction · 0.85
addPathHelperFunction · 0.85

Tested by

no test coverage detected