summaryrefslogtreecommitdiff
path: root/cli/npm/semver/range.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2022-09-28 13:04:16 -0400
committerGitHub <noreply@github.com>2022-09-28 13:04:16 -0400
commitd677ba67f50e5edb0491d8ed1e4171473d662081 (patch)
tree9f8740666298ac8e1041fa3e169d8f3a9e074448 /cli/npm/semver/range.rs
parent23125b275f282f96a6316d11f97e5603dab0d009 (diff)
feat(npm): functionality to support child_process.fork (#15891)
Diffstat (limited to 'cli/npm/semver/range.rs')
-rw-r--r--cli/npm/semver/range.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/cli/npm/semver/range.rs b/cli/npm/semver/range.rs
index faf11580b..901b852c0 100644
--- a/cli/npm/semver/range.rs
+++ b/cli/npm/semver/range.rs
@@ -2,6 +2,9 @@
use std::cmp::Ordering;
+use serde::Deserialize;
+use serde::Serialize;
+
use super::NpmVersion;
/// Collection of ranges.
@@ -14,7 +17,7 @@ impl VersionRangeSet {
}
}
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum RangeBound {
Version(VersionBound),
Unbounded, // matches everything
@@ -91,13 +94,13 @@ impl RangeBound {
}
}
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum VersionBoundKind {
Inclusive,
Exclusive,
}
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct VersionBound {
pub kind: VersionBoundKind,
pub version: NpmVersion,
@@ -109,7 +112,7 @@ impl VersionBound {
}
}
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct VersionRange {
pub start: RangeBound,
pub end: RangeBound,