Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Fix find-missing-results #1826

Merged
merged 3 commits into from
Feb 23, 2022
Merged

Fix find-missing-results #1826

merged 3 commits into from
Feb 23, 2022

Conversation

queengooborg
Copy link
Collaborator

This PR fixes the find-missing-results script. Apparently, when performing '15' > '4', the strings are not converted to numbers during comparison, but rather compared lexicographically. This PR fixes that by replacing one of the sides of the comparison with an integer, so that IE 10 and 11 are included in the list, as well as Safari 10 or higher.

Additionally, this removes the clause to exclude Safari 6.1, since BCD no longer has 6.1 in its data.

@@ -45,12 +45,10 @@ const generateReportMap = (allResults) => {
if (!allResults) {
if (browserKey == 'ie') {
// Ignore super old IE releases
result[browserKey] = result[browserKey].filter((v) => v >= '6');
result[browserKey] = result[browserKey].filter((v) => v >= 6);
Copy link
Owner

Choose a reason for hiding this comment

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

Can you use compareVersions here so that the string→number conversion isn't implicit?

@@ -45,11 +45,13 @@ const generateReportMap = (allResults) => {
if (!allResults) {
if (browserKey == 'ie') {
// Ignore super old IE releases
result[browserKey] = result[browserKey].filter((v) => v >= '6');
result[browserKey] = result[browserKey].filter((v) =>
compareVersions.compare(v, '6', '>')
Copy link
Owner

Choose a reason for hiding this comment

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

Did you intend to change >= to >?

@foolip foolip merged commit 29a9b8c into main Feb 23, 2022
@foolip foolip deleted the find-missing-results branch February 23, 2022 14:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants