$84 GRAYBYTE WORDPRESS FILE MANAGER $75

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/lib/install/

HOME
Current File : /opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/lib/install//inflate-shrinkwrap.js
'use strict'
var asyncMap = require('slide').asyncMap
var validate = require('aproba')
var iferr = require('iferr')
var realizeShrinkwrapSpecifier = require('./realize-shrinkwrap-specifier.js')
var isRegistrySpecifier = require('./is-registry-specifier.js')
var fetchPackageMetadata = require('../fetch-package-metadata.js')
var annotateMetadata = require('../fetch-package-metadata.js').annotateMetadata
var addShrinkwrap = require('../fetch-package-metadata.js').addShrinkwrap
var addBundled = require('../fetch-package-metadata.js').addBundled
var inflateBundled = require('./inflate-bundled.js')
var npm = require('../npm.js')
var createChild = require('./node.js').create
var moduleName = require('../utils/module-name.js')
var childPath = require('../utils/child-path.js')

module.exports = function (tree, swdeps, finishInflating) {
  if (!npm.config.get('shrinkwrap')) return finishInflating()
  return inflateShrinkwrap(tree.path, tree, swdeps, finishInflating)
}

function inflateShrinkwrap (topPath, tree, swdeps, finishInflating) {
  validate('SOOF', arguments)
  var onDisk = {}
  tree.children.forEach(function (child) { onDisk[moduleName(child)] = child })
  tree.children = []
  var dev = npm.config.get('dev') || (!/^prod(uction)?$/.test(npm.config.get('only')) && !npm.config.get('production')) || /^dev(elopment)?$/.test(npm.config.get('only'))
  var prod = !/^dev(elopment)?$/.test(npm.config.get('only'))
  return asyncMap(Object.keys(swdeps), doRealizeAndInflate, finishInflating)

  function doRealizeAndInflate (name, next) {
    return realizeShrinkwrapSpecifier(name, swdeps[name], topPath, iferr(next, andInflate(name, next)))
  }

  function andInflate (name, next) {
    return function (requested) {
      var sw = swdeps[name]
      var dependencies = sw.dependencies || {}
      if ((!prod && !sw.dev) || (!dev && sw.dev)) return next()
      var child = onDisk[name]
      if (childIsEquivalent(sw, requested, child)) {
        if (!child.fromShrinkwrap) child.fromShrinkwrap = requested.raw
        tree.children.push(child)
        annotateMetadata(child.package, requested, requested.raw, topPath)
        return inflateShrinkwrap(topPath, child, dependencies || {}, next)
      } else {
        var from = sw.from || requested.raw
        var optional = sw.optional
        return fetchPackageMetadata(requested, topPath, iferr(next, andAddShrinkwrap(from, optional, dependencies, next)))
      }
    }
  }

  function andAddShrinkwrap (from, optional, dependencies, next) {
    return function (pkg) {
      pkg._from = from
      pkg._optional = optional
      addShrinkwrap(pkg, iferr(next, andAddBundled(pkg, dependencies, next)))
    }
  }

  function andAddBundled (pkg, dependencies, next) {
    return function () {
      return addBundled(pkg, iferr(next, andAddChild(pkg, dependencies, next)))
    }
  }

  function andAddChild (pkg, dependencies, next) {
    return function () {
      var child = createChild({
        package: pkg,
        loaded: false,
        parent: tree,
        fromShrinkwrap: pkg._from,
        path: childPath(tree.path, pkg),
        realpath: childPath(tree.realpath, pkg),
        children: pkg._bundled || []
      })
      tree.children.push(child)
      if (pkg._bundled) {
        delete pkg._bundled
        inflateBundled(child, child.children)
      }
      inflateShrinkwrap(topPath, child, dependencies || {}, next)
    }
  }
}

function childIsEquivalent (sw, requested, child) {
  if (!child) return false
  if (child.fromShrinkwrap) return true
  if (sw.resolved) return child.package._resolved === sw.resolved
  if (!isRegistrySpecifier(requested) && sw.from) return child.package._from === sw.from
  return child.package.version === sw.version
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
31 Aug 2024 8.02 AM
root / root
0755
action
--
31 Aug 2024 8.02 AM
root / root
0755
access-error.js
0.197 KB
28 Sep 2021 4.36 PM
root / root
0644
actions.js
4.974 KB
28 Sep 2021 4.36 PM
root / root
0644
and-add-parent-to-errors.js
0.316 KB
28 Sep 2021 4.36 PM
root / root
0644
and-finish-tracker.js
0.352 KB
28 Sep 2021 4.36 PM
root / root
0644
and-ignore-errors.js
0.199 KB
28 Sep 2021 4.36 PM
root / root
0644
build-path.js
0.237 KB
28 Sep 2021 4.36 PM
root / root
0644
check-permissions.js
1.853 KB
28 Sep 2021 4.36 PM
root / root
0644
copy-tree.js
0.61 KB
28 Sep 2021 4.36 PM
root / root
0644
decompose-actions.js
1.544 KB
28 Sep 2021 4.36 PM
root / root
0644
deps.js
23.229 KB
28 Sep 2021 4.36 PM
root / root
0644
diff-trees.js
5.01 KB
28 Sep 2021 4.36 PM
root / root
0644
exists.js
0.757 KB
28 Sep 2021 4.36 PM
root / root
0644
filter-invalid-actions.js
1 KB
28 Sep 2021 4.36 PM
root / root
0644
flatten-tree.js
0.999 KB
28 Sep 2021 4.36 PM
root / root
0644
inflate-bundled.js
0.48 KB
28 Sep 2021 4.36 PM
root / root
0644
inflate-shrinkwrap.js
3.651 KB
28 Sep 2021 4.36 PM
root / root
0644
is-dev-dep.js
0.171 KB
28 Sep 2021 4.36 PM
root / root
0644
is-extraneous.js
0.868 KB
28 Sep 2021 4.36 PM
root / root
0644
is-fs-access-available.js
0.745 KB
28 Sep 2021 4.36 PM
root / root
0644
is-opt-dep.js
0.181 KB
28 Sep 2021 4.36 PM
root / root
0644
is-prod-dep.js
0.168 KB
28 Sep 2021 4.36 PM
root / root
0644
is-registry-specifier.js
0.168 KB
28 Sep 2021 4.36 PM
root / root
0644
mutate-into-logical-tree.js
4.224 KB
28 Sep 2021 4.36 PM
root / root
0644
node.js
1.43 KB
28 Sep 2021 4.36 PM
root / root
0644
read-shrinkwrap.js
0.863 KB
28 Sep 2021 4.36 PM
root / root
0644
realize-shrinkwrap-specifier.js
0.646 KB
28 Sep 2021 4.36 PM
root / root
0644
report-optional-failure.js
1.017 KB
28 Sep 2021 4.36 PM
root / root
0644
save.js
6.381 KB
28 Sep 2021 4.36 PM
root / root
0644
update-package-json.js
1.52 KB
28 Sep 2021 4.36 PM
root / root
0644
validate-args.js
1.824 KB
28 Sep 2021 4.36 PM
root / root
0644
validate-tree.js
2.549 KB
28 Sep 2021 4.36 PM
root / root
0644
writable.js
1.003 KB
28 Sep 2021 4.36 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF