fix: bump up NodeJS to v16

also follow the Recommended Node TSConfig settings for NodeJS v16
https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping#node-16
This commit is contained in:
Kengo TODA
2021-12-24 13:34:11 +08:00
parent 923e182586
commit b8a50788a5
6 changed files with 9836 additions and 53 deletions

62
dist/index.js generated vendored
View File

@ -25,33 +25,22 @@ var __importStar = (this && this.__importStar) || function (mod) {
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const core = __importStar(__nccwpck_require__(186));
const wait_1 = __nccwpck_require__(817);
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
const ms = core.getInput('milliseconds');
core.debug(`Waiting ${ms} milliseconds ...`); // debug is only output if you set the secret `ACTIONS_STEP_DEBUG` to true
core.debug(new Date().toTimeString());
yield (0, wait_1.wait)(parseInt(ms, 10));
core.debug(new Date().toTimeString());
core.setOutput('time', new Date().toTimeString());
}
catch (error) {
if (error instanceof Error)
core.setFailed(error.message);
}
});
async function run() {
try {
const ms = core.getInput('milliseconds');
core.debug(`Waiting ${ms} milliseconds ...`); // debug is only output if you set the secret `ACTIONS_STEP_DEBUG` to true
core.debug(new Date().toTimeString());
await (0, wait_1.wait)(parseInt(ms, 10));
core.debug(new Date().toTimeString());
core.setOutput('time', new Date().toTimeString());
}
catch (error) {
if (error instanceof Error)
core.setFailed(error.message);
}
}
run();
@ -59,29 +48,18 @@ run();
/***/ }),
/***/ 817:
/***/ (function(__unused_webpack_module, exports) {
/***/ ((__unused_webpack_module, exports) => {
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.wait = void 0;
function wait(milliseconds) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise(resolve => {
if (isNaN(milliseconds)) {
throw new Error('milliseconds not a number');
}
setTimeout(() => resolve('done!'), milliseconds);
});
async function wait(milliseconds) {
return new Promise(resolve => {
if (isNaN(milliseconds)) {
throw new Error('milliseconds not a number');
}
setTimeout(() => resolve('done!'), milliseconds);
});
}
exports.wait = wait;