caniuse-api
caniuse-api copied to clipboard
`isSupported` reporting false negatives
It seems that isSupported
is reporting false
whenever a version has a "note".
Take for example ES6: https://caniuse.com/#feat=es6
caniuse.isSupported('es6', 'chrome 74')
returns false
(as does caniuse.isSupported('es6', 'firefox 66')
) which makes little sense. I'd expect to always return true
if the version is marked in CanIUse as supported (dark green). Someone could argue that if that there is a note it means that something happens with it (in this example, missing tail call optimization), but that's what partially support (light green) means, doesn't it? If the note was important enough not to consider the feature as supported, it wouldn't be marked in dark green.
The problem is in this line https://github.com/Nyalab/caniuse-api/blob/1b74c10257e36877709da4f6630513db10203a78/src/index.js#L49
To be precise the y
switch, for partial support the switch value is a
.
Would the maintainer be open to accept a PR?