oxc-browserslist 3.0.2

Rust-ported Browserslist for Oxc.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::cmp::Ordering;

use super::{Distrib, QueryResult};
use crate::data::node::NODE_VERSIONS;

pub(super) fn node_bounded_range(from: &str, to: &str) -> QueryResult {
    let distribs = NODE_VERSIONS()
        .iter()
        .filter(|version| {
            matches!(version.loose_compare(from), Ordering::Greater | Ordering::Equal)
                && matches!(version.loose_compare(to), Ordering::Less | Ordering::Equal)
        })
        .map(|version| Distrib::new("node", version.to_string()))
        .collect();
    Ok(distribs)
}