1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//! # js-semver
//!
//! <p>
//! <a href="https://github.com/ryuapp/js-semver/blob/main/LICENSE">
//! <img alt="License" src="https://img.shields.io/github/license/ryuapp/js-semver?labelColor=171717&color=39b54a&label=License">
//! </a>
//! <a href="https://crates.io/crates/js-semver">
//! <img alt="crates" src="https://img.shields.io/crates/v/js-semver?labelColor=171717&color=39b54a">
//! </a>
//! <a href="https://github.com/ryuapp/js-semver">
//! <img alt="github repo" src="https://img.shields.io/badge/GitHub-ryuapp/js--semver-171717?labelColor=171717&color=39b54a">
//! </a>
//! <a href="https://codecov.io/gh/ryuapp/js-semver">
//! <img alt="codecov" src="https://codecov.io/gh/ryuapp/js-semver/graph/badge.svg?token=P7NMEB4IP7">
//! </a>
//! </p>
//!
//! Parser and evaluator for npm's flavor of Semantic Versioning, compliant with node-semver.
//!
//! This crate is designed for the JavaScript ecosystem and follows [node-semver](https://github.com/npm/node-semver) (the one npm uses) parsing and range semantics.
//! It maintains high compatibility and performance, and has zero dependencies by default.
//!
//!
//! # Examples
//!
//! ```rust
//! use js_semver::{BuildMetadata, PreRelease, Range, Version};
//!
//! fn main() {
//! let range: Range = ">=4.1.0 <5.0.0".parse().unwrap();
//!
//! // Pre-release versions are not included in the range unless explicitly specified.
//! let version = Version {
//! major: 4,
//! minor: 1,
//! patch: 0,
//! pre_release: PreRelease::new("rc.1").unwrap(),
//! build: BuildMetadata::default(),
//! };
//! assert!(!range.satisfies(&version));
//!
//! // Stable version is included in the range.
//! let version: Version = "4.1.0".parse().unwrap();
//! assert!(range.satisfies(&version));
//! }
//! ```
extern crate alloc;
// --------------------------------------------------------------------------
// Constants
// --------------------------------------------------------------------------
/// Maximum accepted length for any version or range string.
pub const MAX_LENGTH: usize = 256;
pub use SemverError;
pub use ;
pub use Range;
pub use Version;