Skip to content
This repository has been archived by the owner on May 11, 2018. It is now read-only.

Fill data with electron as a target. #229

Merged
merged 11 commits into from
Mar 29, 2017
Prev Previous commit
Next Next commit
Fix closest chrome for intermediate values.
  • Loading branch information
yavorsky committed Mar 28, 2017
commit 40eb3b2a2629081d7c0baca84248c53140a57614
8 changes: 4 additions & 4 deletions data/plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"node": 5,
"ios": 10,
"opera": 33,
"electron": 0.35
"electron": 0.36
},
"transform-es2015-computed-properties": {
"chrome": 44,
Expand Down Expand Up @@ -117,7 +117,7 @@
"node": 5,
"ios": 10,
"opera": 33,
"electron": 0.35
"electron": 0.36
},
"transform-es2015-parameters": {
"chrome": 49,
Expand Down Expand Up @@ -147,7 +147,7 @@
"node": 5,
"ios": 10,
"opera": 33,
"electron": 0.35
"electron": 0.36
},
"transform-es2015-sticky-regex": {
"chrome": 49,
Expand Down Expand Up @@ -215,7 +215,7 @@
"safari": 10.1,
"node": 7.6,
"opera": 42,
"electron": 1.5
"electron": 1.6
},
"syntax-trailing-function-commas": {
"chrome": 58,
Expand Down
10 changes: 4 additions & 6 deletions scripts/build-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ const findClosestElectronVersion = (targetVersion) => {
const chromiumVersionsLength = chromiumToElectronVersions.length;
const maxChromium = +chromiumToElectronVersions[chromiumVersionsLength - 1];
if (targetVersion > maxChromium) return null;
const closestChrome = chromiumToElectronVersions.reduce((result, version) => {
if (targetVersion >= version) {
return version;
}
return result;
});

const closestChrome = chromiumToElectronVersions.find(
(version) => targetVersion <= version
);
return chromiumToElectronMap[closestChrome];
};

Expand Down