caniuse-api icon indicating copy to clipboard operation
caniuse-api copied to clipboard

`isSupported` reporting false negatives

Open acalvo opened this issue 5 years ago • 1 comments

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.

acalvo avatar May 30 '19 11:05 acalvo

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?

alan-agius4 avatar Jun 08 '19 18:06 alan-agius4