+21
-21
lines changedFilter options
+21
-21
lines changed Original file line number Diff line number Diff line change
@@ -106,7 +106,7 @@ class Diff extends BaseCommand {
106
106
const pkgName = await this.packageName()
107
107
return [
108
108
`${pkgName}@${this.npm.config.get('tag')}`,
109
-
`file:${this.prefix.replace(/#/g, '%23')}`,
109
+
`file:${this.prefix}`,
110
110
]
111
111
}
112
112
@@ -134,7 +134,7 @@ class Diff extends BaseCommand {
134
134
}
135
135
return [
136
136
`${pkgName}@${a}`,
137
-
`file:${this.prefix.replace(/#/g, '%23')}`,
137
+
`file:${this.prefix}`,
138
138
]
139
139
}
140
140
@@ -166,7 +166,7 @@ class Diff extends BaseCommand {
166
166
}
167
167
return [
168
168
`${spec.name}@${spec.fetchSpec}`,
169
-
`file:${this.prefix.replace(/#/g, '%23')}`,
169
+
`file:${this.prefix}`,
170
170
]
171
171
}
172
172
@@ -179,7 +179,7 @@ class Diff extends BaseCommand {
179
179
}
180
180
}
181
181
182
-
const aSpec = `file:${node.realpath.replace(/#/g, '%23')}`
182
+
const aSpec = `file:${node.realpath}`
183
183
184
184
// finds what version of the package to compare against, if a exact
185
185
// version or tag was passed than it should use that, otherwise
@@ -212,8 +212,8 @@ class Diff extends BaseCommand {
212
212
]
213
213
} else if (spec.type === 'directory') {
214
214
return [
215
-
`file:${spec.fetchSpec.replace(/#/g, '%23')}`,
216
-
`file:${this.prefix.replace(/#/g, '%23')}`,
215
+
`file:${spec.fetchSpec}`,
216
+
`file:${this.prefix}`,
217
217
]
218
218
} else {
219
219
throw this.usageError(`Spec type ${spec.type} not supported.`)
@@ -281,7 +281,7 @@ class Diff extends BaseCommand {
281
281
282
282
const res = !node || !node.package || !node.package.version
283
283
? spec.fetchSpec
284
-
: `file:${node.realpath.replace(/#/g, '%23')}`
284
+
: `file:${node.realpath}`
285
285
286
286
return `${spec.name}@${res}`
287
287
})
Original file line number Diff line number Diff line change
@@ -124,7 +124,7 @@ class Link extends ArboristWorkspaceCmd {
124
124
...this.npm.flatOptions,
125
125
prune: false,
126
126
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)}`),
128
128
save,
129
129
workspaces: this.workspaceNames,
130
130
})
@@ -135,7 +135,7 @@ class Link extends ArboristWorkspaceCmd {
135
135
async linkPkg () {
136
136
const wsp = this.workspacePaths
137
137
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}`)
139
139
const globalTop = resolve(this.npm.globalDir, '..')
140
140
const Arborist = require('@npmcli/arborist')
141
141
const arb = new Arborist({
Original file line number Diff line number Diff line change
@@ -447,7 +447,7 @@ module.exports = cls => class IdealTreeBuilder extends cls {
447
447
.catch(/* istanbul ignore next */ () => null)
448
448
if (st && st.isSymbolicLink()) {
449
449
const target = await readlink(dir)
450
-
const real = resolve(dirname(dir), target).replace(/#/g, '%23')
450
+
const real = resolve(dirname(dir), target)
451
451
tree.package.dependencies[name] = `file:${real}`
452
452
} else {
453
453
tree.package.dependencies[name] = '*'
@@ -522,12 +522,12 @@ module.exports = cls => class IdealTreeBuilder extends cls {
522
522
523
523
const { name } = spec
524
524
if (spec.type === 'file') {
525
-
spec = npa(`file:${relpath(path, spec.fetchSpec).replace(/#/g, '%23')}`, path)
525
+
spec = npa(`file:${relpath(path, spec.fetchSpec)}`, path)
526
526
spec.name = name
527
527
} else if (spec.type === 'directory') {
528
528
try {
529
529
const real = await realpath(spec.fetchSpec, this[_rpcache], this[_stcache])
530
-
spec = npa(`file:${relpath(path, real).replace(/#/g, '%23')}`, path)
530
+
spec = npa(`file:${relpath(path, real)}`, path)
531
531
spec.name = name
532
532
} catch {
533
533
// TODO: create synthetic test case to simulate realpath failure
Original file line number Diff line number Diff line change
@@ -216,7 +216,7 @@ module.exports = cls => class ActualLoader extends cls {
216
216
const actualRoot = tree.isLink ? tree.target : tree
217
217
const { dependencies = {} } = actualRoot.package
218
218
for (const [name, kid] of actualRoot.children.entries()) {
219
-
const def = kid.isLink ? `file:${kid.realpath.replace(/#/g, '%23')}` : '*'
219
+
const def = kid.isLink ? `file:${kid.realpath}` : '*'
220
220
dependencies[name] = dependencies[name] || def
221
221
}
222
222
actualRoot.package = { ...actualRoot.package, dependencies }
Original file line number Diff line number Diff line change
@@ -149,7 +149,7 @@ module.exports = cls => class VirtualLoader extends cls {
149
149
})
150
150
151
151
for (const [name, path] of workspaces.entries()) {
152
-
lockWS[name] = `file:${path.replace(/#/g, '%23')}`
152
+
lockWS[name] = `file:${path}`
153
153
}
154
154
155
155
// Should rootNames exclude optional?
Original file line number Diff line number Diff line change
@@ -1364,7 +1364,7 @@ module.exports = cls => class Reifier extends cls {
1364
1364
// path initially, in which case we can end up with the wrong
1365
1365
// thing, so just get the ultimate fetchSpec and relativize it.
1366
1366
const p = req.fetchSpec.replace(/^file:/, '')
1367
-
const rel = relpath(addTree.realpath, p).replace(/#/g, '%23')
1367
+
const rel = relpath(addTree.realpath, p)
1368
1368
newSpec = `file:${rel}`
1369
1369
}
1370
1370
} else {
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ const consistentResolve = (resolved, fromPath, toPath, relPaths = false) => {
20
20
raw,
21
21
} = npa(resolved, fromPath)
22
22
if (type === 'file' || type === 'directory') {
23
-
const cleanFetchSpec = fetchSpec.replace(/#/g, '%23')
23
+
const cleanFetchSpec = fetchSpec
24
24
if (relPaths && toPath) {
25
25
return `file:${relpath(toPath, cleanFetchSpec)}`
26
26
}
Original file line number Diff line number Diff line change
@@ -99,7 +99,7 @@ class Link extends Node {
99
99
// the path/realpath guard is there for the benefit of setting
100
100
// these things in the "wrong" order
101
101
return this.path && this.realpath
102
-
? `file:${relpath(dirname(this.path), this.realpath).replace(/#/g, '%23')}`
102
+
? `file:${relpath(dirname(this.path), this.realpath)}`
103
103
: null
104
104
}
105
105
Original file line number Diff line number Diff line change
@@ -842,7 +842,7 @@ class Node {
842
842
}
843
843
844
844
for (const [name, path] of this.#workspaces.entries()) {
845
-
new Edge({ from: this, name, spec: `file:${path.replace(/#/g, '%23')}`, type: 'workspace' })
845
+
new Edge({ from: this, name, spec: `file:${path}`, type: 'workspace' })
846
846
}
847
847
}
848
848
Original file line number Diff line number Diff line change
@@ -817,7 +817,7 @@ class Shrinkwrap {
817
817
if (!/^file:/.test(resolved)) {
818
818
pathFixed = resolved
819
819
} else {
820
-
pathFixed = `file:${resolve(this.path, resolved.slice(5)).replace(/#/g, '%23')}`
820
+
pathFixed = `file:${resolve(this.path, resolved.slice(5))}`
821
821
}
822
822
}
823
823
@@ -1011,7 +1011,7 @@ class Shrinkwrap {
1011
1011
}
1012
1012
1013
1013
if (node.isLink) {
1014
-
lock.version = `file:${relpath(this.path, node.realpath).replace(/#/g, '%23')}`
1014
+
lock.version = `file:${relpath(this.path, node.realpath)}`
1015
1015
} else if (spec && (spec.type === 'file' || spec.type === 'remote')) {
1016
1016
lock.version = spec.saveSpec
1017
1017
} else if (spec && spec.type === 'git' || rSpec.type === 'git') {
@@ -1089,7 +1089,7 @@ class Shrinkwrap {
1089
1089
// this especially shows up with workspace edges when the root
1090
1090
// node is also a workspace in the set.
1091
1091
const p = resolve(node.realpath, spec.slice('file:'.length))
1092
-
set[k] = `file:${relpath(node.realpath, p).replace(/#/g, '%23')}`
1092
+
set[k] = `file:${relpath(node.realpath, p)}`
1093
1093
} else {
1094
1094
set[k] = spec
1095
1095
}
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4