browserslist_data/
node.rs1use chrono::NaiveDate;
2
3include!("generated/node-versions.rs");
4include!("generated/node-release-schedule.rs");
5
6pub fn versions() -> &'static [&'static str] {
7 NODE_VERSIONS
8}
9
10pub fn release_schedule(now: NaiveDate) -> impl Iterator<Item = &'static str> {
11 let end = NODE_RELEASE_SCHEDULE.partition_point(|(_, end)| end <= &now);
12 NODE_RELEASE_SCHEDULE
13 .iter()
14 .enumerate()
15 .skip(end)
16 .filter(move |(_, (start, _))| start < &now)
17 .map(|(idx, _)| NODE_RELEASE_VERSIONS[idx])
18}