Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make
<=11
work the same as in npm
The current version of `<=` in this crate does not fully match npm. For example, `<=11` currently is equivalent to `<=11.0.0-0` however in npm `<=11` is equivalent to `<12` (or `<=11.MAX_SAFE_INTEGER.MAX_SAFE_INTEGER`) Example application: ```rust use nodejs_semver::{Range, Version}; fn main() { let range = "<=11"; let version = "11.0.0"; let req: Range = range.parse().expect(&format!("err: {}", range)); let version: Version = version.parse().expect(&format!("err: {}", version)); println!("result: {}", version.satisfies(&req)); println!("result: {}", req.satisfies(&version)); } ``` running the above example without this patch: ``` result: false result: false ``` running the above example with this patch: ``` result: true result: true ```
- Loading branch information