[Gradle, JS] RejectAll => reject wildcard
^KT-41054 fixed
This commit is contained in:
+2
@@ -65,6 +65,8 @@ infix fun NpmRange.union(other: NpmRange): List<NpmRange> {
|
||||
}
|
||||
|
||||
fun NpmRange.invert(): List<NpmRange> {
|
||||
if (startVersion == null && endVersion == null) return emptyList()
|
||||
|
||||
val result = mutableListOf<NpmRange>()
|
||||
if (startVersion != null || endVersion == null) {
|
||||
result.add(
|
||||
|
||||
+1
@@ -175,5 +175,6 @@ class NpmRangeVisitor : NodeSemverExpressionBaseVisitor<List<NpmRange>>() {
|
||||
|
||||
const val AND = " "
|
||||
const val OR = " || "
|
||||
const val WILDCARD = "*"
|
||||
}
|
||||
}
|
||||
+3
-5
@@ -5,15 +5,15 @@
|
||||
|
||||
package org.jetbrains.kotlin.gradle.targets.js.npm
|
||||
|
||||
import com.github.gundy.semver4j.SemVer
|
||||
import org.gradle.api.internal.artifacts.dependencies.DefaultMutableVersionConstraint
|
||||
import org.jetbrains.kotlin.gradle.targets.js.npm.NpmRangeVisitor.Companion.WILDCARD
|
||||
|
||||
class NpmVersionConstraint(
|
||||
version: String
|
||||
) : DefaultMutableVersionConstraint(version) {
|
||||
override fun rejectAll() {
|
||||
super.rejectAll()
|
||||
reject(NONE_VERSION)
|
||||
reject(WILDCARD)
|
||||
}
|
||||
|
||||
fun toSemVer(): String {
|
||||
@@ -37,6 +37,4 @@ class NpmVersionConstraint(
|
||||
true
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const val NONE_VERSION = "0.0.0"
|
||||
}
|
||||
Reference in New Issue
Block a user