Skip to content

Commit 5f5de54

Browse files
committed
refactor(utils): Make isVersionRange an extension of Identifier
A future commit is going to use it and this change prevents polluting the `String` namespace. Signed-off-by: Nicolas Nobelis <[email protected]>
1 parent 57864b5 commit 5f5de54

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

model/src/main/kotlin/utils/VersionUtils.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ internal fun Identifier.isApplicableIvyVersion(pkgId: Identifier) =
4242
runCatching {
4343
if (version == pkgId.version) return true
4444

45-
if (version.isVersionRange()) {
45+
if (isVersionRange()) {
4646
// `Semver.satisfies(String)` requires a valid version range to work as expected, see:
4747
// https://github.com/semver4j/semver4j/issues/132.
4848
val range = RangesListFactory.create(version)
@@ -63,4 +63,4 @@ internal fun Identifier.isApplicableIvyVersion(pkgId: Identifier) =
6363
it.showStackTrace()
6464
}.getOrDefault(false)
6565

66-
private fun String.isVersionRange() = versionRangeIndicators.any { contains(it, ignoreCase = true) }
66+
private fun Identifier.isVersionRange() = versionRangeIndicators.any { version.contains(it, ignoreCase = true) }

0 commit comments

Comments
 (0)