mirror of
https://git.mirrors.martin98.com/https://github.com/cyberman54/curl
synced 2026-04-23 16:28:06 +08:00
first commit
This commit is contained in:
26
dist/util.js
vendored
Normal file
26
dist/util.js
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||
result["default"] = mod;
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var core = __importStar(require("@actions/core"));
|
||||
exports.validateStatusCode = function (actualStatusCode) {
|
||||
var acceptedStatusCode = core.getInput('accept')
|
||||
.split(",").filter(function (x) { return x !== ""; })
|
||||
.map(function (x) { return x.trim(); });
|
||||
if (!acceptedStatusCode.includes(actualStatusCode)) {
|
||||
throw new Error("The accepted status code is " + acceptedStatusCode + " but got " + actualStatusCode);
|
||||
}
|
||||
};
|
||||
exports.buildOutput = function (res) {
|
||||
return JSON.stringify({
|
||||
"status_code": res.status,
|
||||
"data": res.data,
|
||||
"headers": res.headers
|
||||
});
|
||||
};
|
||||
//# sourceMappingURL=util.js.map
|
||||
Reference in New Issue
Block a user