GRAYBYTE WORDPRESS FILE MANAGER2869

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /lib/node_modules/npm/lib/install/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /lib/node_modules/npm/lib/install//read-shrinkwrap.js
'use strict'

const BB = require('bluebird')

const fs = require('graceful-fs')
const iferr = require('iferr')
const inflateShrinkwrap = require('./inflate-shrinkwrap.js')
const log = require('npmlog')
const parseJSON = require('../utils/parse-json.js')
const path = require('path')
const PKGLOCK_VERSION = require('../npm.js').lockfileVersion

const readFileAsync = BB.promisify(fs.readFile)

module.exports = readShrinkwrap
function readShrinkwrap (child, next) {
  if (child.package._shrinkwrap) return process.nextTick(next)
  BB.join(
    maybeReadFile('npm-shrinkwrap.json', child),
    // Don't read non-root lockfiles
    child.isTop && maybeReadFile('package-lock.json', child),
    (shrinkwrap, lockfile) => {
      if (shrinkwrap && lockfile) {
        log.warn('read-shrinkwrap', 'Ignoring package-lock.json because there is already an npm-shrinkwrap.json. Please use only one of the two.')
      }
      const name = shrinkwrap ? 'npm-shrinkwrap.json' : 'package-lock.json'
      const parsed = parsePkgLock(shrinkwrap || lockfile, name)
      if (parsed && parsed.lockfileVersion !== PKGLOCK_VERSION) {
        log.warn('read-shrinkwrap', `This version of npm is compatible with lockfileVersion@${PKGLOCK_VERSION}, but ${name} was generated for lockfileVersion@${parsed.lockfileVersion || 0}. I'll try to do my best with it!`)
      }
      child.package._shrinkwrap = parsed
    }
  ).then(() => next(), next)
}

function maybeReadFile (name, child) {
  return readFileAsync(
    path.join(child.path, name),
    'utf8'
  ).catch({code: 'ENOENT'}, () => null)
}

module.exports.andInflate = function (child, next) {
  readShrinkwrap(child, iferr(next, function () {
    if (child.package._shrinkwrap) {
      return inflateShrinkwrap(child, child.package._shrinkwrap || {}, next)
    } else {
      return next()
    }
  }))
}

const PARENT_RE = /\|{7,}/g
const OURS_RE = /<{7,}/g
const THEIRS_RE = /={7,}/g
const END_RE = />{7,}/g

module.exports._isDiff = isDiff
function isDiff (str) {
  return str.match(OURS_RE) && str.match(THEIRS_RE) && str.match(END_RE)
}

module.exports._parsePkgLock = parsePkgLock
function parsePkgLock (str, filename) {
  if (!str) { return null }
  try {
    return parseJSON(str)
  } catch (e) {
    if (isDiff(str)) {
      log.warn('conflict', `A git conflict was detected in ${filename}. Attempting to auto-resolve.`)
      log.warn('conflict', 'To make this happen automatically on git rebase/merge, consider using the npm-merge-driver:')
      log.warn('conflict', '$ npx npm-merge-driver install -g')
      const pieces = str.split(/[\n\r]+/g).reduce((acc, line) => {
        if (line.match(PARENT_RE)) acc.state = 'parent'
        else if (line.match(OURS_RE)) acc.state = 'ours'
        else if (line.match(THEIRS_RE)) acc.state = 'theirs'
        else if (line.match(END_RE)) acc.state = 'top'
        else {
          if (acc.state === 'top' || acc.state === 'ours') acc.ours += line
          if (acc.state === 'top' || acc.state === 'theirs') acc.theirs += line
          if (acc.state === 'top' || acc.state === 'parent') acc.parent += line
        }
        return acc
      }, {
        state: 'top',
        ours: '',
        theirs: '',
        parent: ''
      })
      try {
        const ours = parseJSON(pieces.ours)
        const theirs = parseJSON(pieces.theirs)
        return reconcileLockfiles(ours, theirs)
      } catch (_e) {
        log.error('conflict', `Automatic conflict resolution failed. Please manually resolve conflicts in ${filename} and try again.`)
        log.silly('conflict', `Error during resolution: ${_e}`)
        throw e
      }
    } else {
      throw e
    }
  }
}

function reconcileLockfiles (parent, ours, theirs) {
  return Object.assign({}, ours, theirs)
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
March 03 2024 22:36:29
root / root
0755
action
--
March 03 2024 22:36:29
root / root
0755
access-error.js
0.197 KB
March 10 2021 14:36:36
root / root
0644
actions.js
5.516 KB
March 10 2021 14:36:36
root / root
0644
and-add-parent-to-errors.js
0.366 KB
March 10 2021 14:36:36
root / root
0644
and-finish-tracker.js
0.352 KB
March 10 2021 14:36:36
root / root
0644
and-ignore-errors.js
0.199 KB
March 10 2021 14:36:36
root / root
0644
audit.js
8.243 KB
March 10 2021 14:36:36
root / root
0644
check-permissions.js
1.853 KB
March 10 2021 14:36:36
root / root
0644
copy-tree.js
0.752 KB
March 10 2021 14:36:36
root / root
0644
decompose-actions.js
2.18 KB
March 10 2021 14:36:36
root / root
0644
deps.js
30.32 KB
March 10 2021 14:36:36
root / root
0644
diff-trees.js
9.119 KB
March 10 2021 14:36:36
root / root
0644
exists.js
0.757 KB
March 10 2021 14:36:36
root / root
0644
flatten-tree.js
0.997 KB
March 10 2021 14:36:36
root / root
0644
fund.js
1.282 KB
March 10 2021 14:36:36
root / root
0644
get-requested.js
0.62 KB
March 10 2021 14:36:36
root / root
0644
has-modern-meta.js
0.686 KB
March 10 2021 14:36:36
root / root
0644
inflate-bundled.js
0.613 KB
March 10 2021 14:36:36
root / root
0644
inflate-shrinkwrap.js
8.873 KB
March 10 2021 14:36:36
root / root
0644
is-dev-dep.js
0.171 KB
March 10 2021 14:36:36
root / root
0644
is-extraneous.js
0.604 KB
March 10 2021 14:36:36
root / root
0644
is-fs-access-available.js
0.745 KB
March 10 2021 14:36:36
root / root
0644
is-only-dev.js
1.238 KB
March 10 2021 14:36:36
root / root
0644
is-only-optional.js
0.658 KB
March 10 2021 14:36:36
root / root
0644
is-opt-dep.js
0.181 KB
March 10 2021 14:36:36
root / root
0644
is-prod-dep.js
0.168 KB
March 10 2021 14:36:36
root / root
0644
module-staging-path.js
0.253 KB
March 10 2021 14:36:36
root / root
0644
mutate-into-logical-tree.js
4.516 KB
March 10 2021 14:36:36
root / root
0644
node.js
1.851 KB
March 10 2021 14:36:36
root / root
0644
read-shrinkwrap.js
3.672 KB
March 10 2021 14:36:36
root / root
0644
realize-shrinkwrap-specifier.js
0.606 KB
March 10 2021 14:36:36
root / root
0644
report-optional-failure.js
1.017 KB
March 10 2021 14:36:36
root / root
0644
save.js
5.908 KB
March 10 2021 14:36:36
root / root
0644
update-package-json.js
1.87 KB
March 10 2021 14:36:36
root / root
0644
validate-args.js
2.731 KB
March 10 2021 14:36:36
root / root
0644
validate-tree.js
3.104 KB
March 10 2021 14:36:36
root / root
0644
writable.js
1.003 KB
March 10 2021 14:36:36
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF