browserslist

Function resolve

Source
pub fn resolve<I, S>(queries: I, opts: &Opts) -> Result<Vec<Distrib>, Error>
where S: AsRef<str>, I: IntoIterator<Item = S>,
Expand description

Resolve browserslist queries.

This is a low-level API. If you want to load queries from configuration file and resolve them automatically, use the higher-level API execute instead.

use browserslist::{Distrib, Opts, resolve};

let distribs = resolve(["ie <= 6"], &Opts::default()).unwrap();
assert_eq!(distribs[0].name(), "ie");
assert_eq!(distribs[0].version(), "6");
assert_eq!(distribs[1].name(), "ie");
assert_eq!(distribs[1].version(), "5.5");