1
0
Fork 0

fix(core): Treat dependencies as array

This is for #971
This commit is contained in:
Joost De Cock 2021-04-23 20:09:16 +02:00
parent c197c4a4d1
commit 5c72645d45

View file

@ -540,10 +540,8 @@ Pattern.prototype.resolveDependency = function (
deps = []
) {
if (typeof seen[part] === 'undefined') seen[part] = true
if (typeof graph[part] === 'string') {
if (deps.indexOf(graph[part]) === -1) deps.push(graph[part])
return this.resolveDependency(seen, graph[part], graph, deps)
} else if (Array.isArray(graph[part])) {
if (typeof graph[part] === 'string') graph[part] = [graph[part]]
if (Array.isArray(graph[part])) {
if (graph[part].length === 0) return []
else {
if (deps.indexOf(graph[part]) === -1) deps.push(...graph[part])