tra-analysis/website/node_modules/npm/lib/install/inflate-bundled.js

19 lines
628 B
JavaScript
Raw Normal View History

2019-01-06 19:14:45 +00:00
'use strict'
var childPath = require('../utils/child-path.js')
var reset = require('./node.js').reset
module.exports = function inflateBundled (bundler, parent, children) {
children.forEach(function (child) {
if (child.fromBundle === bundler) return
reset(child)
child.fromBundle = bundler
child.isInLink = bundler.isLink
child.parent = parent
child.path = childPath(parent.path, child)
child.realpath = bundler.isLink ? child.realpath : childPath(parent.realpath, child)
child.isLink = child.isLink || parent.isLink || parent.target
inflateBundled(bundler, child, child.children)
})
}