Skip to content

Commit c1fefc5

Browse files
committed
This commit updates npm-package-arg from v12.0.1 to v12.0.2. It also removes all usage of `.replace(/#/g, '%23')` for compatibility with the new version. See: npm/npm-package-arg#203
1 parent 3a80a7b commit c1fefc5

File tree

13 files changed

+187
-124
lines changed

13 files changed

+187
-124
lines changed

lib/commands/diff.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class Diff extends BaseCommand {
106106
const pkgName = await this.packageName()
107107
return [
108108
`${pkgName}@${this.npm.config.get('tag')}`,
109-
`file:${this.prefix.replace(/#/g, '%23')}`,
109+
`file:${this.prefix}`,
110110
]
111111
}
112112

@@ -134,7 +134,7 @@ class Diff extends BaseCommand {
134134
}
135135
return [
136136
`${pkgName}@${a}`,
137-
`file:${this.prefix.replace(/#/g, '%23')}`,
137+
`file:${this.prefix}`,
138138
]
139139
}
140140

@@ -166,7 +166,7 @@ class Diff extends BaseCommand {
166166
}
167167
return [
168168
`${spec.name}@${spec.fetchSpec}`,
169-
`file:${this.prefix.replace(/#/g, '%23')}`,
169+
`file:${this.prefix}`,
170170
]
171171
}
172172

@@ -179,7 +179,7 @@ class Diff extends BaseCommand {
179179
}
180180
}
181181

182-
const aSpec = `file:${node.realpath.replace(/#/g, '%23')}`
182+
const aSpec = `file:${node.realpath}`
183183

184184
// finds what version of the package to compare against, if a exact
185185
// version or tag was passed than it should use that, otherwise
@@ -212,8 +212,8 @@ class Diff extends BaseCommand {
212212
]
213213
} else if (spec.type === 'directory') {
214214
return [
215-
`file:${spec.fetchSpec.replace(/#/g, '%23')}`,
216-
`file:${this.prefix.replace(/#/g, '%23')}`,
215+
`file:${spec.fetchSpec}`,
216+
`file:${this.prefix}`,
217217
]
218218
} else {
219219
throw this.usageError(`Spec type ${spec.type} not supported.`)
@@ -281,7 +281,7 @@ class Diff extends BaseCommand {
281281

282282
const res = !node || !node.package || !node.package.version
283283
? spec.fetchSpec
284-
: `file:${node.realpath.replace(/#/g, '%23')}`
284+
: `file:${node.realpath}`
285285

286286
return `${spec.name}@${res}`
287287
})

lib/commands/link.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class Link extends ArboristWorkspaceCmd {
124124
...this.npm.flatOptions,
125125
prune: false,
126126
path: this.npm.prefix,
127-
add: names.map(l => `file:${resolve(globalTop, 'node_modules', l).replace(/#/g, '%23')}`),
127+
add: names.map(l => `file:${resolve(globalTop, 'node_modules', l)}`),
128128
save,
129129
workspaces: this.workspaceNames,
130130
})
@@ -135,7 +135,7 @@ class Link extends ArboristWorkspaceCmd {
135135
async linkPkg () {
136136
const wsp = this.workspacePaths
137137
const paths = wsp && wsp.length ? wsp : [this.npm.prefix]
138-
const add = paths.map(path => `file:${path.replace(/#/g, '%23')}`)
138+
const add = paths.map(path => `file:${path}`)
139139
const globalTop = resolve(this.npm.globalDir, '..')
140140
const Arborist = require('@npmcli/arborist')
141141
const arb = new Arborist({

0 commit comments

Comments
 (0)