Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2021-03-19 00:50:50 +0300
committerRuy Adorno <ruyadorno@hotmail.com>2021-03-19 01:15:39 +0300
commitd98edd124a61d2331f45599ba6f6dfc42f07cbce (patch)
tree26b2935def6f944d10d1b1c9c05efd18814a00b3 /lib
parent33c4189f939aebdfaf85ea419e6ea01d0977b79d (diff)
restore npm.flatOptions.npmCommandisaacs/restore-npm-command-flat-option
This is used by npm-registry-fetch to set the 'npm-command' HTTP header. Will be cleaned up in a less ugly way in config refactor part 2. PR-URL: https://github.com/npm/cli/pull/2903 Credit: @isaacs Close: #2903 Reviewed-by: @wraithgar
Diffstat (limited to 'lib')
-rw-r--r--lib/npm.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/npm.js b/lib/npm.js
index bc65cc79b..42541a90f 100644
--- a/lib/npm.js
+++ b/lib/npm.js
@@ -213,7 +213,10 @@ const npm = module.exports = new class extends EventEmitter {
}
get flatOptions () {
- return this.config.flat
+ const { flat } = this.config
+ if (this.command)
+ flat.npmCommand = this.command
+ return flat
}
get lockfileVersion () {