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

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/lib/utils/config/definitions.js')
-rw-r--r--deps/npm/lib/utils/config/definitions.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/deps/npm/lib/utils/config/definitions.js b/deps/npm/lib/utils/config/definitions.js
index 3a50175d5db..aa90de8e760 100644
--- a/deps/npm/lib/utils/config/definitions.js
+++ b/deps/npm/lib/utils/config/definitions.js
@@ -1943,6 +1943,7 @@ define('user-agent', {
'node/{node-version} ' +
'{platform} ' +
'{arch} ' +
+ 'workspaces/{workspaces} ' +
'{ci}',
type: String,
description: `
@@ -1953,17 +1954,23 @@ define('user-agent', {
* \`{node-version}\` - The Node.js version in use
* \`{platform}\` - The value of \`process.platform\`
* \`{arch}\` - The value of \`process.arch\`
+ * \`{workspaces}\` - Set to \`true\` if the \`workspaces\` or \`workspace\`
+ options are set.
* \`{ci}\` - The value of the \`ci-name\` config, if set, prefixed with
\`ci/\`, or an empty string if \`ci-name\` is empty.
`,
flatten (key, obj, flatOptions) {
const value = obj[key]
const ciName = obj['ci-name']
+ let inWorkspaces = false
+ if (obj.workspaces || obj.workspace && obj.workspace.length)
+ inWorkspaces = true
flatOptions.userAgent =
value.replace(/\{node-version\}/gi, obj['node-version'])
.replace(/\{npm-version\}/gi, obj['npm-version'])
.replace(/\{platform\}/gi, process.platform)
.replace(/\{arch\}/gi, process.arch)
+ .replace(/\{workspaces\}/gi, inWorkspaces)
.replace(/\{ci\}/gi, ciName ? `ci/${ciName}` : '')
.trim()
// user-agent is a unique kind of config item that gets set from a template