• Home
  • Raw
  • Download

Lines Matching refs:child

43 function doesChildVersionMatch (child, requested, requestor) {  argument
44 if (child.fromShrinkwrap && !child.hasRequiresFromLock) return true
50 if (!child.isLink) return false
51 return path.relative(child.realpath, requested.fetchSpec) === ''
54 if (requested.type === 'git' && child.fromShrinkwrap) {
55 const fromSw = child.package._from ? npa(child.package._from) : child.fromShrinkwrap
61 const sameRepo = npa(child.package._from).fetchSpec === requested.fetchSpec
63 return sameRepo && semver.satisfies(child.package.version, requested.gitRange, true)
70 return doesChildVersionMatch(child, requested.subSpec, requestor)
74 var childReq = child.package._requested
90 if (child.package._from) {
91 var fromReq = npa(child.package._from)
98 return semver.satisfies(child.package.version, requested.fetchSpec, true)
125 var child = findRequirement(tree, req.name, req)
126 if (child) {
127 resolveWithExistingModule(child, tree)
147 tree.children.filter((child) => !child.removed).forEach((child) => computeMetadata(child, seen))
152 function isDep (tree, child) { argument
153 var name = moduleName(child)
163 if (prodSpec) matches = doesChildVersionMatch(child, prodSpec, tree)
165 if (devVer === prodVer) return {isDep: child.fromShrinkwrap, isProdDep: false, isDevDep: false}
168 …return {isDep: doesChildVersionMatch(child, devSpec, tree) || child.fromShrinkwrap, isProdDep: fal…
170 return {isDep: child.fromShrinkwrap, isProdDep: false, isDevDep: false}
174 function addRequiredDep (tree, child) { argument
175 var dep = isDep(tree, child)
177 replaceModuleByPath(child, 'requiredBy', tree)
178 replaceModuleByName(tree, 'requires', child)
179 if (dep.isProdDep && tree.missingDeps) delete tree.missingDeps[moduleName(child)]
180 if (dep.isDevDep && tree.missingDevDeps) delete tree.missingDevDeps[moduleName(child)]
185 function removeObsoleteDep (child, log) { argument
186 if (child.removed) return
187 child.removed = true
189 log.silly('removeObsoleteDep', 'removing ' + packageId(child) +
193 if (child.parent) {
194child.parent.children = child.parent.children.filter(function (pchild) { return pchild !== child })
197 var requires = child.requires || []
199 …requirement.requiredBy = requirement.requiredBy.filter(function (reqBy) { return reqBy !== child })
267 …ewModule(pkg, tree, log.newGroup('loadRequestedDeps'), iferr(depLoaded, function (child, tracker) { argument
270 child.isGlobal = true
272 var childName = moduleName(child)
273 child.saveSpec = computeVersionSpec(tree, child)
274 child.userRequired = true
275 child.save = getSaveType(tree, child)
277 if (child.save) {
278 tree.package[child.save][childName] = child.saveSpec
287 if (child.save !== saveType) {
291 … if (child.save === 'optionalDependencies') tree.package.dependencies[childName] = child.saveSpec
297 var childIsDep = addRequiredDep(tree, child)
298 if (!childIsDep) child.userRequired = true
299 depLoaded(null, child, tracker)
309 function computeVersionSpec (tree, child) { argument
312 var childReq = child.package._requested
313 if (child.isLink) {
314 requested = npa.resolve(moduleName(child), 'file:' + child.realpath, getTop(tree).path)
316 requested = child.package._requested
317 } else if (child.package._from) {
318 requested = npa(child.package._from, tree.path)
319 } else if (child.name && child.name !== child.package.name) {
320 requested = npa.resolve(child.name, `npm:${child.package.name}@${child.package.version})`)
322 requested = npa.resolve(child.package.name, child.package.version)
325 var version = child.package.version
344 return function (child) { return moduleName(child) === name } argument
367 parent.requires = parent.requires.filter((child) => child !== pkgToRemove)
466 return function (er, child, childLog) { argument
467 if (!er) validate('OO', [child, childLog])
468 if (!er) return done(er, child, childLog)
474 return done(er, child, childLog)
549 for (var child of tree.children) {
550 if (child.loaded) continue
551 resolveWithExistingModule(child, tree)
552 loadExtraneous(child)
565 asyncMap(tree.children.filter(function (child) { return !child.loaded }), function (child, done) { argument
566 resolveWithExistingModule(child, tree)
567 done(null, child, log)
582 var child = findRequirement(tree, name, req)
583 if (!child && swReq) child = findRequirement(tree, name, swReq)
584 if (hasModernMeta(child)) {
585 resolveWithExistingModule(child, tree)
586 if (child.package._shrinkwrap === undefined) {
587 readShrinkwrap.andInflate(child, function (er) { next(er, child, log) })
589 next(null, child, log)
592 if (child) {
594 req = childDependencySpecifier(tree, name, child.package.version)
596 if (child.fromBundle) reportBundleOverride(child, log)
597 removeObsoleteDep(child, log)
614 function reportBundleOverride (child, log) { argument
616 const top = getTop(child.fromBundle)
617 const bundlerId = packageId(child.fromBundle)
625 …code}: Replacing ${bundlerId}'s bundled version of ${moduleName(child)} with ${packageId(child)}.`)
628 function resolveWithExistingModule (child, tree) { argument
630 addRequiredDep(tree, child)
631 if (tree.parent && child.parent !== tree) updatePhantomChildren(tree.parent, child)
634 var updatePhantomChildren = exports.updatePhantomChildren = function (current, child) {
636 while (current && current !== child.parent) {
638 current.phantomChildren[moduleName(child)] = child
644 function replaceModuleByPath (obj, key, child) { argument
645 return replaceModule(obj, key, child, function (replacing, child) { argument
646 return replacing.path === child.path
651 function replaceModuleByName (obj, key, child) { argument
652 var childName = moduleName(child)
653 return replaceModule(obj, key, child, function (replacing, child) { argument
658 function replaceModule (obj, key, child, matchBy) { argument
666 if (matchBy(children[replaceAt], child)) break
668 var replacing = children.splice(replaceAt, 1, child)
683 var child = createChild({
694 if (!installable || bundleErr) child.failed = true
696 var hasBundled = child.children.length
698 var replaced = replaceModuleByName(parent, 'children', child)
703 addRequiredDep(tree, child)
704 child.location = flatNameFromTree(child)
706 if (tree.parent && parent !== tree) updatePhantomChildren(tree.parent, child)
709 inflateBundled(child, child, child.children)
713 return inflateShrinkwrap(child, pkg._shrinkwrap, (swErr) => {
714 if (swErr) child.failed = true
715 next(err || bundleErr || swErr, child, log)
718 next(err || bundleErr, child, log)
750 tree.children.forEach(function (child) { validateAllPeerDeps(child, onInvalid, seen) }) argument
758 var nameMatch = function (child) { argument
759 return moduleName(child) === name && child.parent && !child.removed
761 var versionMatch = function (child) { argument
762 return doesChildVersionMatch(child, requested, requestor)
796 function undeletedModuleMatches (child) { argument
797 …return !child.removed && moduleName(child) === ((pkg._requested && pkg._requested.name) || pkg.nam…
815 var binaryMatches = pkg.bin && tree.children.some(function (child) { argument
816 if (child.removed || !child.package.bin) return false
817 return Object.keys(child.package.bin).some(function (bin) {