diff options
author | Kat Marchán <kzm@zkat.tech> | 2019-01-29 14:43:00 -0800 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2019-02-12 00:06:29 -0800 |
commit | 43dd49c9782848c25e5b03448c8a0f923f13c158 (patch) | |
tree | f7ac5d645019b2b844f26be66c291bbae734d097 /deps/npm/node_modules/pacote/lib/fetchers/directory.js | |
parent | b361f9577fbd72e518438d3fa0b01f7d34d814a5 (diff) | |
download | android-node-v8-43dd49c9782848c25e5b03448c8a0f923f13c158.tar.gz android-node-v8-43dd49c9782848c25e5b03448c8a0f923f13c158.tar.bz2 android-node-v8-43dd49c9782848c25e5b03448c8a0f923f13c158.zip |
deps: upgrade npm to 6.7.0
PR-URL: https://github.com/nodejs/node/pull/25804
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'deps/npm/node_modules/pacote/lib/fetchers/directory.js')
-rw-r--r-- | deps/npm/node_modules/pacote/lib/fetchers/directory.js | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/deps/npm/node_modules/pacote/lib/fetchers/directory.js b/deps/npm/node_modules/pacote/lib/fetchers/directory.js index f6e680f660..83f3d7d558 100644 --- a/deps/npm/node_modules/pacote/lib/fetchers/directory.js +++ b/deps/npm/node_modules/pacote/lib/fetchers/directory.js @@ -14,16 +14,31 @@ const readFileAsync = BB.promisify(require('fs').readFile) const fetchDirectory = module.exports = Object.create(null) Fetcher.impl(fetchDirectory, { + packument (spec, opts) { + return this.manifest(spec, opts).then(manifest => { + return Object.assign({}, manifest, { + 'dist-tags': { + 'latest': manifest.version + }, + time: { + [manifest.version]: (new Date()).toISOString() + }, + versions: { + [manifest.version]: manifest + } + }) + }) + }, // `directory` manifests come from the actual manifest/lockfile data. manifest (spec, opts) { const pkgPath = path.join(spec.fetchSpec, 'package.json') const srPath = path.join(spec.fetchSpec, 'npm-shrinkwrap.json') return BB.join( - readFileAsync(pkgPath).then(JSON.parse).catch({code: 'ENOENT'}, err => { + readFileAsync(pkgPath).then(JSON.parse).catch({ code: 'ENOENT' }, err => { err.code = 'ENOPACKAGEJSON' throw err }), - readFileAsync(srPath).then(JSON.parse).catch({code: 'ENOENT'}, () => null), + readFileAsync(srPath).then(JSON.parse).catch({ code: 'ENOENT' }, () => null), (pkg, sr) => { pkg._shrinkwrap = sr pkg._hasShrinkwrap = !!sr @@ -35,7 +50,7 @@ Fetcher.impl(fetchDirectory, { ).then(pkg => { if (!pkg.bin && pkg.directories && pkg.directories.bin) { const dirBin = pkg.directories.bin - return glob(path.join(spec.fetchSpec, dirBin, '/**'), {nodir: true}).then(matches => { + return glob(path.join(spec.fetchSpec, dirBin, '/**'), { nodir: true }).then(matches => { matches.forEach(filePath => { const relative = path.relative(spec.fetchSpec, filePath) if (relative && relative[0] !== '.') { |