From 52e6400a5813b0cdb0afd19bdab4778430ff24be Mon Sep 17 00:00:00 2001 From: Pavan Kumar Sunkara Date: Mon, 6 Jan 2020 12:32:16 +0530 Subject: [PATCH] fix: extendPackage object values should be string --- packages/@vue/cli/lib/util/mergeDeps.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/@vue/cli/lib/util/mergeDeps.js b/packages/@vue/cli/lib/util/mergeDeps.js index 4bbc17bc54..b7b0bf5798 100644 --- a/packages/@vue/cli/lib/util/mergeDeps.js +++ b/packages/@vue/cli/lib/util/mergeDeps.js @@ -10,9 +10,10 @@ module.exports = function resolveDeps (generatorId, to, from, sources, forceNewV for (const name in from) { const r1 = to[name] const r2 = from[name] + const r2IsString = typeof r2 === 'string' const sourceGeneratorId = sources[name] - const isValidURI = r2.match(/^(?:file|git|git\+ssh|git\+http|git\+https|git\+file|https?):/) != null - const isValidGitHub = r2.match(/^[^/]+\/[^/]+/) != null + const isValidURI = r2IsString && r2.match(/^(?:file|git|git\+ssh|git\+http|git\+https|git\+file|https?):/) != null + const isValidGitHub = r2IsString && r2.match(/^[^/]+\/[^/]+/) != null // if they are the same, do nothing. Helps when non semver type deps are used if (r1 === r2) continue