PHP 8.1.33
Preview: node.js Size: 1.85 KB
//lib/node_modules/npm/lib/install/node.js

'use strict'

var defaultTemplate = {
  package: {
    version: '',
    dependencies: {},
    devDependencies: {},
    optionalDependencies: {}
  },
  loaded: false,
  children: [],
  requiredBy: [],
  requires: [],
  missingDeps: {},
  missingDevDeps: {},
  phantomChildren: {},
  path: null,
  realpath: null,
  location: null,
  userRequired: false,
  save: false,
  saveSpec: null,
  isTop: false,
  fromBundle: false
}

function isLink (node) {
  return node && node.isLink
}
function isInLink (node) {
  return node && (node.isInLink || node.isLink)
}

var create = exports.create = function (node, template, isNotTop) {
  if (!template) template = defaultTemplate
  Object.keys(template).forEach(function (key) {
    if (template[key] != null && typeof template[key] === 'object' && !(template[key] instanceof Array)) {
      if (!node[key]) node[key] = {}
      return create(node[key], template[key], true)
    }
    if (node[key] != null) return
    node[key] = template[key]
  })
  if (!isNotTop) {
    // isLink is true for the symlink and everything inside it.
    // by contrast, isInLink is true for only the things inside a link
    if (node.isLink == null) node.isLink = isLink(node.parent)
    if (node.isInLink == null) node.isInLink = isInLink(node.parent)
    if (node.fromBundle == null) {
      node.fromBundle = false
    }
  }
  return node
}

exports.reset = function (node) {
  reset(node, new Set())
}

function reset (node, seen) {
  if (seen.has(node)) return
  seen.add(node)
  var child = create(node)

  // FIXME: cleaning up after read-package-json's mess =(
  if (child.package._id === '@') delete child.package._id

  child.isTop = false
  child.requiredBy = []
  child.requires = []
  child.missingDeps = {}
  child.missingDevDeps = {}
  child.phantomChildren = {}
  child.location = null

  child.children.forEach(function (child) { reset(child, seen) })
}

Directory Contents

Dirs: 1 × Files: 36

Name Size Perms Modified Actions
action DIR
- drwxr-xr-x 2024-03-03 22:36:29
Edit Download
202 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
5.52 KB lrw-r--r-- 2021-03-10 14:36:36
Edit Download
375 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
360 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
204 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
8.24 KB lrw-r--r-- 2021-03-10 14:36:36
Edit Download
1.85 KB lrw-r--r-- 2021-03-10 14:36:36
Edit Download
770 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
2.18 KB lrw-r--r-- 2021-03-10 14:36:36
Edit Download
30.32 KB lrw-r--r-- 2021-03-10 14:36:36
Edit Download
9.12 KB lrw-r--r-- 2021-03-10 14:36:36
Edit Download
775 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
1021 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
1.28 KB lrw-r--r-- 2021-03-10 14:36:36
Edit Download
635 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
702 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
628 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
8.87 KB lrw-r--r-- 2021-03-10 14:36:36
Edit Download
175 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
618 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
763 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
1.24 KB lrw-r--r-- 2021-03-10 14:36:36
Edit Download
674 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
185 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
172 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
259 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
4.52 KB lrw-r--r-- 2021-03-10 14:36:36
Edit Download
1.85 KB lrw-r--r-- 2021-03-10 14:36:36
Edit Download
3.67 KB lrw-r--r-- 2021-03-10 14:36:36
Edit Download
621 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
1.02 KB lrw-r--r-- 2021-03-10 14:36:36
Edit Download
5.91 KB lrw-r--r-- 2021-03-10 14:36:36
Edit Download
1.87 KB lrw-r--r-- 2021-03-10 14:36:36
Edit Download
2.73 KB lrw-r--r-- 2021-03-10 14:36:36
Edit Download
3.10 KB lrw-r--r-- 2021-03-10 14:36:36
Edit Download
1.00 KB lrw-r--r-- 2021-03-10 14:36:36
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).