oxc-browserslist 4.0.0

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(|(_, text)| Distrib::new("node", text.as_ref()))
        .collect();
    Ok(distribs)
}