`mobileToDesktop` doesn't change the browser name
npx browserslist --mobile-to-desktop ">3%, and_chr 50"
Actual
and_chr 81
and_chr 50
chrome 83
ios_saf 13.4-13.5
Expected
chrome 50
chrome 81
chrome 83
ios_saf 13.4-13.5
Currently, mobileToDesktop logic is only applied to byName:
https://github.com/browserslist/browserslist/blob/f5ff062d9ed723bfa7de9121ddeef27e1e7aa5fe/index.js#L245-L249
Is this intended behavior?
Nope, let's fix it in pull request
@ai Looking at the code and commits, it turns out mobileToDesktop doesn't change the mobile browser to desktop one like what the doc says and its name suggests, but only resolves the version part using desktop one:
https://github.com/browserslist/browserslist/blob/f5ff062d9ed723bfa7de9121ddeef27e1e7aa5fe/index.js#L254
I think there are two ways to proceed:
- Change the browser name if
mobileToDesktopis true. This may be a breaking change since it modifies the behavior of an existing option. - Add another option, something like
normalize, along with #508. I think it can take arrays of normalizer names, e.g.,mobileToDesktop,chromiumToChrome, or custom functions.
I like new option