mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
feat(transformer): support Targets::from_query method (#5336)
This commit is contained in:
parent
3d4a64c811
commit
d04857bd35
1 changed files with 7 additions and 0 deletions
|
|
@ -29,6 +29,13 @@ impl Default for Targets {
|
|||
}
|
||||
|
||||
impl Targets {
|
||||
/// Create a `Targets` from a browserslist query.
|
||||
///
|
||||
/// The usage refer to the [browserslist](https://github.com/browserslist/browserslist?tab=readme-ov-file#queries) documentation.
|
||||
pub fn from_query(query: &str) -> Self {
|
||||
Targets::Query(Query::Single(query.into()))
|
||||
}
|
||||
|
||||
/// Parse the query and return the parsed Versions.
|
||||
///
|
||||
/// # Errors
|
||||
|
|
|
|||
Loading…
Reference in a new issue