Skip to content

Commit 43fb4ad

Browse files
committedMay 30, 2022
Bump ES version to 2021
1 parent b88a8c8 commit 43fb4ad

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed
 

‎.eslintrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"env": { "node": true, "jest": true },
33
"parser": "@typescript-eslint/parser",
4-
"parserOptions": { "ecmaVersion": 2019, "sourceType": "module" },
4+
"parserOptions": { "ecmaVersion": 2021, "sourceType": "module" },
55
"extends": [
66
"eslint:recommended",
77
"plugin:@typescript-eslint/eslint-recommended",

‎dist/index.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -618,13 +618,12 @@ const fs_1 = __importDefault(__nccwpck_require__(147));
618618
const fetch = __importStar(__nccwpck_require__(387));
619619
const utils = __importStar(__nccwpck_require__(918));
620620
async function getSemverVersion(data) {
621-
var _a;
622621
const search = data['version_prefix'] + data['version'];
623622
const url = `https://api.github.com/repos/${data['repository']}/git/matching-refs/tags%2F${search}.`;
624623
const token = await utils.readEnv('COMPOSER_TOKEN');
625624
const response = await fetch.fetch(url, token);
626625
if (response.error || response.data === '[]') {
627-
data['error'] = (_a = response.error) !== null && _a !== void 0 ? _a : `No version found with prefix ${search}.`;
626+
data['error'] = response.error ?? `No version found with prefix ${search}.`;
628627
return data['version'];
629628
}
630629
else {
@@ -874,7 +873,6 @@ async function addWPCLI(data) {
874873
}
875874
exports.addWPCLI = addWPCLI;
876875
async function getData(release, php_version, os) {
877-
var _a, _b, _c, _d, _e;
878876
const json_file_path = path_1.default.join(__dirname, '../src/configs/tools.json');
879877
const json_file = fs_1.default.readFileSync(json_file_path, 'utf8');
880878
const json_objects = JSON.parse(json_file);
@@ -905,16 +903,16 @@ async function getData(release, php_version, os) {
905903
}
906904
}
907905
data['github'] = 'https://github.com';
908-
(_a = data['domain']) !== null && _a !== void 0 ? _a : (data['domain'] = data['github']);
909-
(_b = data['extension']) !== null && _b !== void 0 ? _b : (data['extension'] = '.phar');
906+
data['domain'] ??= data['github'];
907+
data['extension'] ??= '.phar';
910908
data['os'] = os;
911909
data['php_version'] = php_version;
912910
data['prefix'] = data['github'] === data['domain'] ? 'releases' : '';
913911
data['verb'] = data['github'] === data['domain'] ? 'download' : '';
914-
(_c = data['fetch_latest']) !== null && _c !== void 0 ? _c : (data['fetch_latest'] = 'false');
915-
(_d = data['scope']) !== null && _d !== void 0 ? _d : (data['scope'] = 'global');
912+
data['fetch_latest'] ??= 'false';
913+
data['scope'] ??= 'global';
916914
data['version_parameter'] = JSON.stringify(data['version_parameter']) || '';
917-
(_e = data['version_prefix']) !== null && _e !== void 0 ? _e : (data['version_prefix'] = '');
915+
data['version_prefix'] ??= '';
918916
data['release'] = await getRelease(release, data);
919917
data['version'] = version
920918
? await getVersion(version, data)

‎tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"declaration": true,
44
"esModuleInterop": true,
55
"lib": [
6-
"ES2020"
6+
"ES2021"
77
],
88
"module": "commonjs",
99
"moduleResolution": "node",
@@ -13,7 +13,7 @@
1313
"rootDir": "./src",
1414
"sourceMap": true,
1515
"strict": true,
16-
"target": "ES2019"
16+
"target": "ES2021"
1717
},
1818
"exclude": ["__tests__", "lib", "node_modules"]
1919
}

0 commit comments

Comments
 (0)