KT-34468 Yarn. Star version support fix

This commit is contained in:
Victor Turansky
2020-03-23 20:35:40 +03:00
committed by Ilya Goncharov
parent d494881cb9
commit 0d1bf66c2a
@@ -114,11 +114,13 @@ abstract class YarnBasics : NpmApi {
visited[src] = src
val key = dependencyKey(src.key, src.version)
val deps = byKey[key]
?: if (src.version == "*") byKey.entries
val deps = if (src.version != "*") {
byKey[key]
} else {
byKey.entries
.firstOrNull { it.key.startsWith(dependencyKey(src.key, "")) }
?.value
else null
}
if (deps == null) {
error("Cannot find $key in yarn.lock")