Sha256: 22274160ff2845fc1212bdbadae28d41db1b6dc88d017e8c80100e710d3280fa
Contents?: true
Size: 1.44 KB
Versions: 26
Compression:
Stored size: 1.44 KB
Contents
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/glossary.ts var IS_PATCHED_MODULE = Symbol("isPatchedModule"); // src/utils/isPropertyAccessible.ts function isPropertyAccessible(obj, key) { try { obj[key]; return true; } catch (e) { return false; } } // src/utils/responseUtils.ts var RESPONSE_STATUS_CODES_WITHOUT_BODY = /* @__PURE__ */ new Set([ 101, 103, 204, 205, 304 ]); var RESPONSE_STATUS_CODES_WITH_REDIRECT = /* @__PURE__ */ new Set([ 301, 302, 303, 307, 308 ]); function isResponseWithoutBody(status) { return RESPONSE_STATUS_CODES_WITHOUT_BODY.has(status); } function createServerErrorResponse(body) { return new Response( JSON.stringify( body instanceof Error ? { name: body.name, message: body.message, stack: body.stack } : body ), { status: 500, statusText: "Unhandled Exception", headers: { "Content-Type": "application/json" } } ); } function isResponseError(response) { return isPropertyAccessible(response, "type") && response.type === "error"; } exports.IS_PATCHED_MODULE = IS_PATCHED_MODULE; exports.RESPONSE_STATUS_CODES_WITH_REDIRECT = RESPONSE_STATUS_CODES_WITH_REDIRECT; exports.isResponseWithoutBody = isResponseWithoutBody; exports.createServerErrorResponse = createServerErrorResponse; exports.isResponseError = isResponseError; //# sourceMappingURL=chunk-2CAGU4FT.js.map
Version data entries
26 entries across 26 versions & 1 rubygems