Bump compat-table and regen preset-env data (#7401)

This commit is contained in:
Brian Ng 2018-02-23 08:46:14 -06:00 committed by GitHub
parent 182fe7b04e
commit 455c04e60a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 9 deletions

1
.prettierignore Normal file
View File

@ -0,0 +1 @@
package.json

View File

@ -1149,7 +1149,7 @@
"es7.promise.finally": {
"chrome": "63",
"firefox": "58",
"safari": "tp",
"safari": "11.1",
"opera": "50"
}
}

View File

@ -220,7 +220,7 @@
},
"transform-dotall-regex": {
"chrome": "62",
"safari": "tp",
"safari": "11.1",
"opera": "49"
},
"proposal-async-generator-functions": {
@ -232,17 +232,19 @@
"proposal-object-rest-spread": {
"chrome": "60",
"firefox": "55",
"safari": "tp",
"safari": "11.1",
"node": "8.3",
"opera": "47"
},
"proposal-optional-catch-binding": {
"chrome": "66",
"firefox": "58",
"safari": "tp"
"safari": "11.1",
"opera": "53"
},
"proposal-unicode-property-regex": {
"chrome": "64",
"safari": "tp",
"safari": "11.1",
"opera": "51"
}
}

View File

@ -57,7 +57,7 @@
"@babel/core": "7.0.0-beta.40",
"@babel/helper-fixtures": "7.0.0-beta.40",
"@babel/helper-plugin-test-runner": "7.0.0-beta.40",
"compat-table": "kangax/compat-table#3e30cd67a5d3d853caf8424d00ca66d100674d4f",
"compat-table": "kangax/compat-table#7c202e2da648fbd9d223d48d1680ec8f15147044",
"electron-to-chromium": "^1.3.27",
"request": "^2.83.0"
}

View File

@ -8,12 +8,16 @@ const request = require("request");
// * https://html.spec.whatwg.org/multipage/scripting.html#attr-script-type
const lastKnown = {
chrome: 61,
firefox: 59,
safari: 10.1,
ios_saf: 10.3,
edge: 16,
};
const acceptedWithCaveats = {
safari: true,
ios_saf: true,
};
function input() {
return new Promise(function(resolve, reject) {
request(
@ -38,12 +42,15 @@ function input() {
const browserVersions = stats[browser];
const allowedVersions = Object.keys(browserVersions)
.filter(value => {
return browserVersions[value] === "y";
return acceptedWithCaveats[browser]
? browserVersions[value][0] === "a"
: browserVersions[value] === "y";
})
.sort((a, b) => a - b);
if (allowedVersions[0] !== undefined) {
allowedBrowsers[browser] = allowedVersions[0];
// Handle cases where caniuse specifies version as: "11.0-11.2"
allowedBrowsers[browser] = allowedVersions[0].split("-")[0];
}
}
});