Skip to content

Commit 52e6400

Browse files
authored
fix: extendPackage object values should be string
1 parent 413470d commit 52e6400

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/@vue/cli/lib/util/mergeDeps.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ module.exports = function resolveDeps (generatorId, to, from, sources, forceNewV
1010
for (const name in from) {
1111
const r1 = to[name]
1212
const r2 = from[name]
13+
const r2IsString = typeof r2 === 'string'
1314
const sourceGeneratorId = sources[name]
14-
const isValidURI = r2.match(/^(?:file|git|git\+ssh|git\+http|git\+https|git\+file|https?):/) != null
15-
const isValidGitHub = r2.match(/^[^/]+\/[^/]+/) != null
15+
const isValidURI = r2IsString && r2.match(/^(?:file|git|git\+ssh|git\+http|git\+https|git\+file|https?):/) != null
16+
const isValidGitHub = r2IsString && r2.match(/^[^/]+\/[^/]+/) != null
1617

1718
// if they are the same, do nothing. Helps when non semver type deps are used
1819
if (r1 === r2) continue

0 commit comments

Comments
 (0)