mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
Version range compression utils (#2840)
* DNF normalization wip * a bunch of wip stuff * it is alive! * tests * deduplicate strings in tests * fix != flavor behavior & parse flavor constraints & equals shorthand for normalize * use normalization * more comments & fix tests not running because of bad rebase * fix comments+tests * slightly better comment * fix dependency & typos --------- Co-authored-by: Aiden McClelland <me@drbonez.dev>
This commit is contained in:
@@ -163,15 +163,17 @@ export class VersionGraph<CurrentVersion extends string> {
|
||||
(v.metadata instanceof ExtendedVersion &&
|
||||
v.metadata.equals(this.currentVersion())),
|
||||
),
|
||||
).reduce(
|
||||
(acc, x) =>
|
||||
acc.or(
|
||||
x.metadata instanceof VersionRange
|
||||
? x.metadata
|
||||
: VersionRange.anchor("=", x.metadata),
|
||||
),
|
||||
VersionRange.none(),
|
||||
),
|
||||
)
|
||||
.reduce(
|
||||
(acc, x) =>
|
||||
acc.or(
|
||||
x.metadata instanceof VersionRange
|
||||
? x.metadata
|
||||
: VersionRange.anchor("=", x.metadata),
|
||||
),
|
||||
VersionRange.none(),
|
||||
)
|
||||
.normalize(),
|
||||
)
|
||||
canMigrateTo = once(() =>
|
||||
Array.from(
|
||||
@@ -182,15 +184,17 @@ export class VersionGraph<CurrentVersion extends string> {
|
||||
(v.metadata instanceof ExtendedVersion &&
|
||||
v.metadata.equals(this.currentVersion())),
|
||||
),
|
||||
).reduce(
|
||||
(acc, x) =>
|
||||
acc.or(
|
||||
x.metadata instanceof VersionRange
|
||||
? x.metadata
|
||||
: VersionRange.anchor("=", x.metadata),
|
||||
),
|
||||
VersionRange.none(),
|
||||
),
|
||||
)
|
||||
.reduce(
|
||||
(acc, x) =>
|
||||
acc.or(
|
||||
x.metadata instanceof VersionRange
|
||||
? x.metadata
|
||||
: VersionRange.anchor("=", x.metadata),
|
||||
),
|
||||
VersionRange.none(),
|
||||
)
|
||||
.normalize(),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user