MCPcopy Create free account
hub / github.com/npm/cli / resolve

Method resolve

workspaces/arborist/lib/node.js:1571–1588  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

1569 }
1570
1571 resolve (name) {
1572 /* istanbul ignore next - should be impossible,
1573 * but I keep doing this mistake in tests */
1574 debug(() => {
1575 if (typeof name !== 'string' || !name) {
1576 throw new Error('non-string passed to Node.resolve')
1577 }
1578 })
1579 const mine = this.children.get(name)
1580 if (mine) {
1581 return mine
1582 }
1583 const resolveParent = this.resolveParent
1584 if (resolveParent) {
1585 return resolveParent.resolve(name)
1586 }
1587 return null
1588 }
1589
1590 inNodeModules () {
1591 const rp = this.realpath

Callers 15

[_reloadNamedEdges]Method · 0.95
getFixtureFunction · 0.80
cli.jsFile · 0.80
readUsernameFunction · 0.80
visitMethod · 0.80
#publishMethod · 0.80
execMethod · 0.80
execMethod · 0.80
completionMethod · 0.80
execMethod · 0.80
htmlManMethod · 0.80
execMethod · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected