chore(es/preset-env): Ignore tp in the version of a browser version (#7968)

This commit is contained in:
Donny/강동윤 2023-09-18 22:20:23 +09:00 committed by GitHub
parent e749328312
commit 005ddc573e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -201,7 +201,17 @@ pub(crate) static FEATURES: Lazy<AHashMap<Feature, BrowserData<Option<Version>>>
.map(|(feature, version)| {
(
feature,
version.map_value(|version| version.map(|v| v.parse().unwrap())),
version.map_value(|version| {
if matches!(version.as_deref(), Some("tp")) {
return None;
}
version.map(|v| {
v.parse().unwrap_or_else(|err| {
panic!("failed to parse `{v}` as a version: {err:?}")
})
})
}),
)
})
.collect()