From 8e81eb532d8b91d886cb62f704299a052dbe2ad6 Mon Sep 17 00:00:00 2001 From: Gaelan Steele Date: Wed, 5 Dec 2018 17:04:48 -0800 Subject: [PATCH] feat(extract): add option to not add fields to package.json --- extract.js | 2 +- lib/util/opt-check.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/extract.js b/extract.js index d2ab47d..e13694b 100644 --- a/extract.js +++ b/extract.js @@ -25,7 +25,7 @@ function extract (spec, dest, opts) { return tryExtract(spec, stream, dest, opts) }) .then(() => { - if (!opts.resolved) { + if (!opts.resolved && !opts.unmodified) { const pjson = path.join(dest, 'package.json') return readFileAsync(pjson, 'utf8') .then(str => truncateAsync(pjson) diff --git a/lib/util/opt-check.js b/lib/util/opt-check.js index e6afc21..2867a7f 100644 --- a/lib/util/opt-check.js +++ b/lib/util/opt-check.js @@ -39,7 +39,8 @@ module.exports = figgyPudding({ tag: { default: 'latest' }, uid: {}, umask: {}, - where: {} + where: {}, + unmodified: {} }, { other (key) { return key.match(AUTH_REGEX) || key.match(SCOPE_REGISTRY_REGEX)