From fbd3e73f6c8d708dbd0eea3172257ff51ca34a5a Mon Sep 17 00:00:00 2001 From: robobun <117481402+robobun@users.noreply.github.com> Date: Thu, 17 Sep 2026 16:12:08 +0000 Subject: [PATCH 1/5] semver: read a wildcard major after < or > as the empty set `x` and `>*` matched every version. node-semver reads them as `<0.0.0-0`, which no version satisfies (replaceXRange). npm therefore never applies an `overrides` key such as `foo@` before a written wildcard major. `Version::parse` reports whether the wildcard was written (`wildcard_written`), because an operator before text that is not a version (`>latest`) reaches the same arm. That text keeps its current reading, which is any version. The same arm no longer puts the numbers after the wildcard into the lower bound, so `>=x.1.2` is `*` as in node-semver. `Interval::is_non_empty` treats `0.0.0-0` as the lower bound when a range has none. `) -> Range { + pub(crate) fn to_range(self, parsed: &version::ParseResult) -> Range { + let version = &parsed.version; match self.tag { // Allows changes that do not modify the left-most non-zero element in the [major, minor, patch] tuple TokenTag::Caret => { @@ -693,18 +694,28 @@ impl Token { } match self.wildcard { - Wildcard::Major => Range { - left: Comparator { - op: RangeOp::Gte, - version: version.min(), + Wildcard::Major => match self.tag { + // https://github.com/npm/node-semver/blob/3a8a4309ae986c1967b3073ba88c9e69433d44cb/classes/range.js#L380-L387 + // A wildcard major makes `<` and `>` allow nothing and `<=` and `>=` allow anything, + // whatever follows it. An operator before text that is not a version (`>latest`) + // also gets here, with no wildcard written, and keeps reading as anything. + TokenTag::Lt | TokenTag::Gt if parsed.wildcard_written => Range { + left: Comparator::null_set(), + ..Default::default() }, - right: Comparator { - op: RangeOp::Lte, - version: Version { - major: u64::MAX, - minor: u64::MAX, - patch: u64::MAX, - ..Default::default() + _ => Range { + left: Comparator { + op: RangeOp::Gte, + version: Version::default(), + }, + right: Comparator { + op: RangeOp::Lte, + version: Version { + major: u64::MAX, + minor: u64::MAX, + patch: u64::MAX, + ..Default::default() + }, }, }, }, @@ -1097,15 +1108,15 @@ pub fn parse(input: &[u8], sliced: SlicedString) -> Result { list.or_version(version)?; } _ => { - list.or_range(&token.to_range(&parse_result.version))?; + list.or_range(&token.to_range(&parse_result))?; } } } else if count == 0 { - list.and_range(&token.to_range(&parse_result.version))?; + list.and_range(&token.to_range(&parse_result))?; } else if is_or { - list.or_range(&token.to_range(&parse_result.version))?; + list.or_range(&token.to_range(&parse_result))?; } else { - list.and_range(&token.to_range(&parse_result.version))?; + list.and_range(&token.to_range(&parse_result))?; } is_or = false; diff --git a/src/semver/SemverRange.rs b/src/semver/SemverRange.rs index af571368366f..5cdb6a73b35f 100644 --- a/src/semver/SemverRange.rs +++ b/src/semver/SemverRange.rs @@ -1,8 +1,9 @@ use core::cmp::Ordering; use core::fmt; -use crate::Version; use crate::query::token::Wildcard; +use crate::version::Tag; +use crate::{SlicedString, Version}; #[repr(u8)] #[derive(Copy, Clone, PartialEq, Eq, Default)] @@ -183,6 +184,21 @@ pub struct Comparator { } impl Comparator { + /// `<0.0.0-0`: no version satisfies it. node-semver uses it for the empty set. + pub(crate) fn null_set() -> Comparator { + let zero: &[u8] = b"0"; + Comparator { + op: Op::Lt, + version: Version { + tag: Tag { + pre: SlicedString::init(zero, zero).external(), + ..Default::default() + }, + ..Default::default() + }, + } + } + /// `< {major+1}.0.0`, or `<= u64::MAX.u64::MAX.u64::MAX` when `major+1` /// would overflow so the desugared range stays non-empty at the ceiling. pub(crate) fn lt_next_major(major: u64) -> Comparator { diff --git a/src/semver/Version.rs b/src/semver/Version.rs index e18595118a2a..848a9025257c 100644 --- a/src/semver/Version.rs +++ b/src/semver/Version.rs @@ -605,6 +605,7 @@ impl VersionType { } _ => {} } + result.wildcard_written = result.wildcard != Wildcard::None; } } c => { @@ -1191,6 +1192,9 @@ pub struct TagResult { pub struct ParseResult { pub wildcard: Wildcard, pub valid: bool, + /// The `wildcard` part is a written `x`, `X` or `*`. False when that part is only absent, + /// as in `1` or in text that is not a version (which also reads as `Wildcard::Major`). + pub(crate) wildcard_written: bool, pub version: Partial, pub(crate) len: u32, } @@ -1200,6 +1204,7 @@ impl Default for ParseResult { Self { wildcard: Wildcard::None, valid: true, + wildcard_written: false, version: Partial::default(), len: 0, } diff --git a/src/semver/intersects.rs b/src/semver/intersects.rs index 736fe6905318..8e7cea926f45 100644 --- a/src/semver/intersects.rs +++ b/src/semver/intersects.rs @@ -75,13 +75,20 @@ impl<'a> Interval<'a> { } fn is_non_empty(&self) -> bool { - match (self.lower, self.upper) { - (Some(l), Some(u)) => match l.version.order_without_build(u.version, l.buf, u.buf) { - Ordering::Less => true, - Ordering::Equal => l.inclusive && u.inclusive, - Ordering::Greater => false, - }, - _ => true, + let Some(u) = self.upper else { + return true; + }; + // `0.0.0-0` is the lowest version, so an interval with no lower bound starts there. + // That makes `<0.0.0-0` (`Comparator::null_set`) empty on its own. + let l = self.lower.unwrap_or_else(|| Bound { + version: Comparator::null_set().version, + buf: b"", + inclusive: true, + }); + match l.version.order_without_build(u.version, l.buf, u.buf) { + Ordering::Less => true, + Ordering::Equal => l.inclusive && u.inclusive, + Ordering::Greater => false, } } } diff --git a/test/cli/install/nested-overrides.test.ts b/test/cli/install/nested-overrides.test.ts index 9308eb302438..e39213708c40 100644 --- a/test/cli/install/nested-overrides.test.ts +++ b/test/cli/install/nested-overrides.test.ts @@ -728,6 +728,30 @@ describe.concurrent("version-scoped targets", () => { await installOk(dir, "--frozen-lockfile"); }); + // node-semver reads `x` as `<0.0.0-0`, the empty set. `intersects` is what npm's semver 7.7.4 + // answers, and npm applies a rule on that answer. Every rule sets 2.0.0. `untouched` is what the declared + // range resolves to without it. + describe.concurrent.each([ + { declared: "^1.0.0", selector: "*", intersects: false, untouched: "1.1.0" }, + // neither side has a lower bound + { declared: "<2", selector: "x", intersects: false, untouched: "1.0.1" }, + // the other alternative of the selector still matches + { declared: "^1.0.0", selector: " %j", ({ declared, selector, intersects, untouched }) => { + test(intersects ? "the rule applies" : "the rule leaves the edge alone", async () => { + const dir = await project({ + dependencies: { "no-deps": declared }, + overrides: { [`no-deps@${selector}`]: "2.0.0" }, + }); + const { err } = await installOk(dir); + expect(err).not.toContain("warn:"); + expect(await versionSeenBy(dir, undefined, "no-deps")).toBe(intersects ? "2.0.0" : untouched); + await installOk(dir, "--frozen-lockfile"); + }); + }); + test("edges declared with a dist-tag never match", async () => { const dir = await project({ dependencies: { "no-deps": "latest", "one-range-dep": "1.0.0" }, diff --git a/test/cli/install/semver.test.ts b/test/cli/install/semver.test.ts index f5de5d394b5e..56d073c562d1 100644 --- a/test/cli/install/semver.test.ts +++ b/test/cli/install/semver.test.ts @@ -549,6 +549,79 @@ describe("Bun.semver.satisfies()", () => { } }); + describe("a wildcard major after < or >", () => { + // node-semver's replaceXRange turns `x` into `<0.0.0-0`, which no version satisfies. + // Every expectation in the first three tests is the answer of npm's semver 7.7.4. + type Row = [range: string, version: string, expected: boolean]; + const check = (rows: Row[]) => + expect(rows.map(([range, version]) => [range, version, satisfies(version, range)])).toEqual(rows); + + test("is the empty set", () => { + const ranges = [ + ...["x", ">X", ">*"], + ...["< x", "> *", "<\tx", "v*"], + ...["x.x", "x.x.x", "<*.*", ">*.*.*"], + // a number or build metadata after the wildcard changes nothing + ...["x.1", "x.1.2", "x.x.x+build"], + ]; + const versions = ["0.0.0", "1.0.0", "1.0.0-beta.1", "0.0.0-0"]; + check(ranges.flatMap(range => versions.map((version): Row => [range, version, false]))); + }); + + test("empties an intersection and drops out of a union", () => { + check([ + [">x <2", "1.2.3", false], + ["<2 >x", "1.2.3", false], + [">=1 =1", "1.2.3", false], + ["<=x *", "1.2.3", false], + ["1.0.0 x", "1.0.0", true], + ["1.0.0 || >x", "2.0.0", false], + ["x || >=3", "3.0.0", true], + [">x || >=3", "2.0.0", false], + ["x", "1.0.0", false], + ]); + }); + + test("every other operator still allows any version", () => { + check([ + ...[">=x", "<=x", ">=*", "<=*", ">=x.x", "<=x.x.x", "<= x", ">= *"].map((range): Row => [range, "1.0.0", true]), + ...["x", "*", "=x", "^x", "~x", "~>x"].map((range): Row => [range, "1.0.0", true]), + // a number after the wildcard changes nothing here either + ...[">=x.1", ">=x.1.2", "<=x.1", "<=x.1.2"].map((range): Row => [range, "0.0.0", true]), + [">=x <2", "1.2.3", true], + [">=x <2", "2.0.0", false], + // a wildcard after a number is a bound, not the empty set + ["<1.x", "0.9.0", true], + ["<1.x", "1.0.0", false], + [">1.x", "2.0.0", true], + [">1.x", "1.9.0", false], + ["<1.2.x", "1.1.9", true], + ["<1.2.x", "1.2.0", false], + [">1.2.x", "1.3.0", true], + [">1.2.x", "1.2.9", false], + ]); + }); + + test("an operator before text that is not a version still allows any version", () => { + // npm calls these ranges invalid. Bun reads the comparator as `*`, and the rows above do not change that. + check([ + [">latest", "1.0.0", true], + ["^1.0.0", "2.0.0", true], + ]); + }); + }); + test("range includes", () => { // https://github.com/npm/node-semver/blob/14d263faa156e408a033b9b12a2f87735c2df42c/test/fixtures/range-include.js#L3 var tests = [ From 72a1446158e00ff402a09bb078b889c3284bccf0 Mon Sep 17 00:00:00 2001 From: robobun <117481402+robobun@users.noreply.github.com> Date: Fri, 18 Sep 2026 10:55:48 +0000 Subject: [PATCH 2/5] semver: leave >= and <= before a wildcard major as they are on main node-semver 7.8.4 rejects a number after a wildcard (`>=x.1.2`), where 7.7.4 read the range as `*`. Keep the lower bound that main takes from those numbers, so this change is only about `<` and `>`. Drop the four test rows that pinned the 7.7.4 reading; the other 134 rows hold on semver 7.7.4, 7.8.3 and 7.8.5. --- src/semver/SemverQuery.rs | 8 ++++---- test/cli/install/semver.test.ts | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/semver/SemverQuery.rs b/src/semver/SemverQuery.rs index b6d1b01520b4..d6e16ec95322 100644 --- a/src/semver/SemverQuery.rs +++ b/src/semver/SemverQuery.rs @@ -696,9 +696,9 @@ impl Token { match self.wildcard { Wildcard::Major => match self.tag { // https://github.com/npm/node-semver/blob/3a8a4309ae986c1967b3073ba88c9e69433d44cb/classes/range.js#L380-L387 - // A wildcard major makes `<` and `>` allow nothing and `<=` and `>=` allow anything, - // whatever follows it. An operator before text that is not a version (`>latest`) - // also gets here, with no wildcard written, and keeps reading as anything. + // A wildcard major makes `<` and `>` allow nothing, whatever follows it. An operator + // before text that is not a version (`>latest`) also gets here, with no wildcard + // written, and keeps reading as anything. TokenTag::Lt | TokenTag::Gt if parsed.wildcard_written => Range { left: Comparator::null_set(), ..Default::default() @@ -706,7 +706,7 @@ impl Token { _ => Range { left: Comparator { op: RangeOp::Gte, - version: Version::default(), + version: version.min(), }, right: Comparator { op: RangeOp::Lte, diff --git a/test/cli/install/semver.test.ts b/test/cli/install/semver.test.ts index 56d073c562d1..6360568dc6fc 100644 --- a/test/cli/install/semver.test.ts +++ b/test/cli/install/semver.test.ts @@ -595,8 +595,6 @@ describe("Bun.semver.satisfies()", () => { check([ ...[">=x", "<=x", ">=*", "<=*", ">=x.x", "<=x.x.x", "<= x", ">= *"].map((range): Row => [range, "1.0.0", true]), ...["x", "*", "=x", "^x", "~x", "~>x"].map((range): Row => [range, "1.0.0", true]), - // a number after the wildcard changes nothing here either - ...[">=x.1", ">=x.1.2", "<=x.1", "<=x.1.2"].map((range): Row => [range, "0.0.0", true]), [">=x <2", "1.2.3", true], [">=x <2", "2.0.0", false], // a wildcard after a number is a bound, not the empty set From df31efa72baeb98afa975413af1391b31398bcdf Mon Sep 17 00:00:00 2001 From: robobun <117481402+robobun@users.noreply.github.com> Date: Fri, 18 Sep 2026 11:22:21 +0000 Subject: [PATCH 3/5] semver: keep text that starts with a wildcard character as any version `>xenial` and `` becomes the empty set. That text now reads as on main, like `>latest`. Tests: rows for that text, a note on why `1.0.0 match self.tag { // https://github.com/npm/node-semver/blob/3a8a4309ae986c1967b3073ba88c9e69433d44cb/classes/range.js#L380-L387 - // A wildcard major makes `<` and `>` allow nothing, whatever follows it. An operator - // before text that is not a version (`>latest`) also gets here, with no wildcard - // written, and keeps reading as anything. - TokenTag::Lt | TokenTag::Gt if parsed.wildcard_written => Range { + // A wildcard major makes `<` and `>` allow nothing. An operator before text that is + // not a version also gets here, with no wildcard written (`>latest`) or as an + // invalid version (`>xenial`), and keeps reading as anything. + TokenTag::Lt | TokenTag::Gt if parsed.valid && parsed.wildcard_written => Range { left: Comparator::null_set(), ..Default::default() }, diff --git a/test/cli/install/nested-overrides.test.ts b/test/cli/install/nested-overrides.test.ts index e39213708c40..ae8ce72bffd6 100644 --- a/test/cli/install/nested-overrides.test.ts +++ b/test/cli/install/nested-overrides.test.ts @@ -729,7 +729,7 @@ describe.concurrent("version-scoped targets", () => { }); // node-semver reads `x` as `<0.0.0-0`, the empty set. `intersects` is what npm's semver 7.7.4 - // answers, and npm applies a rule on that answer. Every rule sets 2.0.0. `untouched` is what the declared + // answers, and npm applies a rule on that answer. Every rule sets 1.0.0. `untouched` is what the declared // range resolves to without it. describe.concurrent.each([ { declared: "^1.0.0", selector: " { test(intersects ? "the rule applies" : "the rule leaves the edge alone", async () => { const dir = await project({ dependencies: { "no-deps": declared }, - overrides: { [`no-deps@${selector}`]: "2.0.0" }, + overrides: { [`no-deps@${selector}`]: "1.0.0" }, }); const { err } = await installOk(dir); expect(err).not.toContain("warn:"); - expect(await versionSeenBy(dir, undefined, "no-deps")).toBe(intersects ? "2.0.0" : untouched); + expect(await versionSeenBy(dir, undefined, "no-deps")).toBe(intersects ? "1.0.0" : untouched); await installOk(dir, "--frozen-lockfile"); }); }); + test("a selector that no version satisfies leaves a * edge alone", async () => { + // npm applies the rule here: its `*` comparator intersects every comparator, `<0.0.0-0` included. + // Bun does not, because no version satisfies the selector. + const dir = await project({ dependencies: { "no-deps": "*" }, overrides: { "no-deps@ { const dir = await project({ dependencies: { "no-deps": "latest", "one-range-dep": "1.0.0" }, diff --git a/test/cli/install/semver.test.ts b/test/cli/install/semver.test.ts index 6360568dc6fc..d23c065f0211 100644 --- a/test/cli/install/semver.test.ts +++ b/test/cli/install/semver.test.ts @@ -576,6 +576,7 @@ describe("Bun.semver.satisfies()", () => { ["=1", "1.2.3", false], ["<=x *", "1.2.3", false], + // The version goes first: a bare version after another comparator is read as an alternative today (#32993). ["1.0.0 { ["^1.0.0", "2.0.0", true], + // text that starts with a wildcard character is still text + [">xenial", "1.0.0", true], + ["*next", "1.0.0", true], + [">x.1.2.3", "1.0.0", true], ]); }); }); From 52f34571d1369f5ae844260cc7178a6c3e012623 Mon Sep 17 00:00:00 2001 From: robobun <117481402+robobun@users.noreply.github.com> Date: Fri, 18 Sep 2026 11:25:35 +0000 Subject: [PATCH 4/5] semver: shorten the new comments to one line each --- src/semver/SemverQuery.rs | 4 +--- src/semver/Version.rs | 3 +-- src/semver/intersects.rs | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/semver/SemverQuery.rs b/src/semver/SemverQuery.rs index 69d79da26bb2..9b1c4453c6d8 100644 --- a/src/semver/SemverQuery.rs +++ b/src/semver/SemverQuery.rs @@ -696,13 +696,11 @@ impl Token { match self.wildcard { Wildcard::Major => match self.tag { // https://github.com/npm/node-semver/blob/3a8a4309ae986c1967b3073ba88c9e69433d44cb/classes/range.js#L380-L387 - // A wildcard major makes `<` and `>` allow nothing. An operator before text that is - // not a version also gets here, with no wildcard written (`>latest`) or as an - // invalid version (`>xenial`), and keeps reading as anything. TokenTag::Lt | TokenTag::Gt if parsed.valid && parsed.wildcard_written => Range { left: Comparator::null_set(), ..Default::default() }, + // An operator before text that is not a version (`>latest`, `>xenial`) also gets here. _ => Range { left: Comparator { op: RangeOp::Gte, diff --git a/src/semver/Version.rs b/src/semver/Version.rs index 848a9025257c..cc4557e77c7e 100644 --- a/src/semver/Version.rs +++ b/src/semver/Version.rs @@ -1192,8 +1192,7 @@ pub struct TagResult { pub struct ParseResult { pub wildcard: Wildcard, pub valid: bool, - /// The `wildcard` part is a written `x`, `X` or `*`. False when that part is only absent, - /// as in `1` or in text that is not a version (which also reads as `Wildcard::Major`). + /// The `wildcard` part is a written `x`, `X` or `*`, not a part that is only absent (`1`, or text with no number). pub(crate) wildcard_written: bool, pub version: Partial, pub(crate) len: u32, diff --git a/src/semver/intersects.rs b/src/semver/intersects.rs index 8e7cea926f45..e7386e1d08c2 100644 --- a/src/semver/intersects.rs +++ b/src/semver/intersects.rs @@ -78,8 +78,7 @@ impl<'a> Interval<'a> { let Some(u) = self.upper else { return true; }; - // `0.0.0-0` is the lowest version, so an interval with no lower bound starts there. - // That makes `<0.0.0-0` (`Comparator::null_set`) empty on its own. + // `0.0.0-0` is the lowest version, so a missing lower bound starts there and `<0.0.0-0` alone is empty. let l = self.lower.unwrap_or_else(|| Bound { version: Comparator::null_set().version, buf: b"", From 0900a35156e1445d4134536e274dc287b0fa072b Mon Sep 17 00:00:00 2001 From: robobun <117481402+robobun@users.noreply.github.com> Date: Fri, 18 Sep 2026 12:02:23 +0000 Subject: [PATCH 5/5] semver: keep `^x` and `~x` as any version inside a union The caret and tilde arms of `Token::to_range` returned a range with no comparator for a wildcard major. `or_range` treats such a head as not set yet, so `^x || 1.0.0` lost the `^x` alternative. Stock bun hid this for `^x || =0.0.0` for a written wildcard major, the range a bare `x` already gets. Text that is not a version (`^latest`, `^xenial`) still adds no comparator. --- src/semver/SemverQuery.rs | 9 ++++++++- test/cli/install/semver.test.ts | 28 +++++++++++++++++++++++++--- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/semver/SemverQuery.rs b/src/semver/SemverQuery.rs index 9b1c4453c6d8..e9edb9c31c5e 100644 --- a/src/semver/SemverQuery.rs +++ b/src/semver/SemverQuery.rs @@ -611,6 +611,7 @@ pub enum Wildcard { impl Token { pub(crate) fn to_range(self, parsed: &version::ParseResult) -> Range { let version = &parsed.version; + let wildcard_is_written = parsed.valid && parsed.wildcard_written; match self.tag { // Allows changes that do not modify the left-most non-zero element in the [major, minor, patch] tuple TokenTag::Caret => { @@ -618,6 +619,9 @@ impl Token { let mut range = Range::default(); 'done: { let Some(major) = version.major else { + if wildcard_is_written { + range = Range::init_wildcard(version.min(), Wildcard::Major); + } break 'done; }; range.left = Comparator { @@ -654,6 +658,9 @@ impl Token { let mut range = Range::default(); 'done: { let Some(major) = version.major else { + if wildcard_is_written { + range = Range::init_wildcard(version.min(), Wildcard::Major); + } break 'done; }; range.left = Comparator { @@ -696,7 +703,7 @@ impl Token { match self.wildcard { Wildcard::Major => match self.tag { // https://github.com/npm/node-semver/blob/3a8a4309ae986c1967b3073ba88c9e69433d44cb/classes/range.js#L380-L387 - TokenTag::Lt | TokenTag::Gt if parsed.valid && parsed.wildcard_written => Range { + TokenTag::Lt | TokenTag::Gt if wildcard_is_written => Range { left: Comparator::null_set(), ..Default::default() }, diff --git a/test/cli/install/semver.test.ts b/test/cli/install/semver.test.ts index d23c065f0211..85a32f56a38c 100644 --- a/test/cli/install/semver.test.ts +++ b/test/cli/install/semver.test.ts @@ -551,7 +551,7 @@ describe("Bun.semver.satisfies()", () => { describe("a wildcard major after < or >", () => { // node-semver's replaceXRange turns `x` into `<0.0.0-0`, which no version satisfies. - // Every expectation in the first three tests is the answer of npm's semver 7.7.4. + // Every expectation but those of the last test is the answer of npm's semver 7.7.4 and 7.8.5. type Row = [range: string, version: string, expected: boolean]; const check = (rows: Row[]) => expect(rows.map(([range, version]) => [range, version, satisfies(version, range)])).toEqual(rows); @@ -610,8 +610,27 @@ describe("Bun.semver.satisfies()", () => { ]); }); - test("an operator before text that is not a version still allows any version", () => { - // npm calls these ranges invalid. Bun reads the comparator as `*`, and the rows above do not change that. + test("a wildcard major after ^ or ~ stays any version inside a union or an intersection", () => { + check([ + ["^x || 1.0.0", "2.0.0", true], + ["~x || 1.0.0", "2.0.0", true], + ["^x.x || 1.0.0", "2.0.0", true], + ["~x.x.x || 1.0.0", "2.0.0", true], + ["^* || <1", "2.0.0", true], + ["1.0.0 || ^x", "2.0.0", true], + ["^x || x || ~X", "2.3.4", true], + ["^x >=3", "2.0.0", false], + ["^x >=3", "3.0.0", true], + [">=3 ~x", "2.0.0", false], + [">=3 ~x", "3.1.0", true], + ]); + }); + + test("an operator before text that is not a version keeps its reading", () => { + // npm calls these ranges invalid. Bun reads the text as `*` after `<` or `>`, and the rows above do not change that. check([ [">latest", "1.0.0", true], [" { ["*next", "1.0.0", true], [">x.1.2.3", "1.0.0", true], + // after `^` the text adds no comparator + ["^latest || 1.0.0", "2.0.0", false], + ["^xenial || 1.0.0", "2.0.0", false], ]); }); });