inflate-bundled.js 628 B

123456789101112131415161718
  1. 'use strict'
  2. var childPath = require('../utils/child-path.js')
  3. var reset = require('./node.js').reset
  4. module.exports = function inflateBundled (bundler, parent, children) {
  5. children.forEach(function (child) {
  6. if (child.fromBundle === bundler) return
  7. reset(child)
  8. child.fromBundle = bundler
  9. child.isInLink = bundler.isLink
  10. child.parent = parent
  11. child.path = childPath(parent.path, child)
  12. child.realpath = bundler.isLink ? child.realpath : childPath(parent.realpath, child)
  13. child.isLink = child.isLink || parent.isLink || parent.target
  14. inflateBundled(bundler, child, child.children)
  15. })
  16. }