summaryrefslogtreecommitdiff
path: root/deps/npm/lib/install/inflate-bundled.js
blob: 66bbb44a33de37b9294193d5fbb7472c193b6666 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'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)
  })
}