decord/source/580_ResponseBase.js

87 lines
2.2 KiB
JavaScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 580
// Function ID: 581
2026-07-20 16:05:17 +00:00
// Name: ResponseBase
2026-07-29 08:29:29 +00:00
// Dependencies: [532]
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
// Module 580 (ResponseBase)
2026-07-20 16:05:17 +00:00
class ResponseBase {
constructor() {
return;
}
get(arg0) {
return this.header[global.toLowerCase(global)];
}
_setHeaderProperties(arg0) {
2026-07-29 08:29:29 +00:00
tmp = global["content-type"] || "";
2026-07-20 16:05:17 +00:00
self = this;
2026-07-23 10:11:24 +00:00
obj = require("_createForOfIteratorHelper");
2026-07-29 08:29:29 +00:00
this.type = obj.type(tmp);
2026-07-23 10:11:24 +00:00
obj2 = require("_createForOfIteratorHelper");
2026-07-29 08:29:29 +00:00
paramsResult = obj2.params(tmp);
for (const key10017 in paramsResult) {
tmp6 = key10017;
2026-07-20 16:05:17 +00:00
_Object = Object;
hasOwnProperty = Object.prototype.hasOwnProperty;
2026-07-29 08:29:29 +00:00
call = hasOwnProperty.call;
if (typeof call === "unknown") {
hasOwnPropertyResult = hasOwnProperty(key10017);
} else {
hasOwnPropertyResult = call(paramsResult, key10017);
}
if (!hasOwnPropertyResult) {
2026-07-20 16:05:17 +00:00
continue;
} else {
2026-07-29 08:29:29 +00:00
self[key10017] = paramsResult[key10017];
2026-07-23 10:11:24 +00:00
continue;
2026-07-20 16:05:17 +00:00
}
continue;
}
self.links = {};
2026-07-29 08:29:29 +00:00
try {
if (!global.link) {
} else {
tmp4 = closure_0;
tmp5 = closure_1;
obj3 = require("_createForOfIteratorHelper");
self.links = obj3.parseLinks(global.link);
}
return;
} catch (err) {
2026-07-20 16:05:17 +00:00
}
return;
}
_setStatusProperties(arg0) {
self = this;
truncResult = Math.trunc(global / 100);
this.statusCode = global;
this.status = this.statusCode;
this.statusType = truncResult;
this.info = 1 === truncResult;
this.ok = 2 === truncResult;
this.redirect = 3 === truncResult;
toErrorResult = 4 === truncResult;
this.clientError = toErrorResult;
tmp3 = 5 === truncResult;
this.serverError = tmp3;
if (!toErrorResult) {
toErrorResult = tmp3;
}
if (toErrorResult) {
toErrorResult = self.toError();
}
self.error = toErrorResult;
self.created = 201 === global;
self.accepted = 202 === global;
self.noContent = 204 === global;
self.badRequest = 400 === global;
self.unauthorized = 401 === global;
self.notAcceptable = 406 === global;
self.forbidden = 403 === global;
self.notFound = 404 === global;
self.unprocessableEntity = 422 === global;
return;
}
}
export default ResponseBase;