Skip to content

Fix false negatives from isSupported#90

Open
underbyte wants to merge 3 commits intoNyalab:masterfrom
underbyte:fix-82
Open

Fix false negatives from isSupported#90
underbyte wants to merge 3 commits intoNyalab:masterfrom
underbyte:fix-82

Conversation

@underbyte
Copy link

This should fix issues #82 and #83.

The problem is that the data set returns as y #x where x is the number mapping to the foot note.

@underbyte underbyte requested a review from Nyalab January 25, 2020 03:41
return browser.split(" ")
})
.every((browser) => {
return data.stats[browser[0]] &&
Copy link

@neenhouse neenhouse Jan 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Support case insensitive search for "Y":

return data.stats[browser[0]] && 
   data.stats[browser[0]][browser[1]] &&
   String.prototype.toLowerCase.call(data.stats[browser[0]][browser[1]][0]) === "y"

Copy link

@neenhouse neenhouse Jan 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, you should incorporate the fix from https://github.com/Nyalab/caniuse-api/pull/61/files here, so:

return data &&
   data.stats[browser[0]] && 
   data.stats[browser[0]][browser[1]] &&
   String.prototype.toLowerCase.call(data.stats[browser[0]][browser[1]][0]) === "y"

@neenhouse
Copy link

@Nyalab - I think this PR looks good. Could you take a look? We need a patch version for a new project we maintain https://github.com/ExpediaGroup/nimbuild/tree/master/packages/nimbuild-corejs.

@celluj34
Copy link

celluj34 commented Dec 7, 2020

It's been almost a year, can we get this merged??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants