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

Version Path
clapton-0.0.26 lib/clapton/javascripts/node_modules/@mswjs/interceptors/lib/browser/chunk-2CAGU4FT.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/@mswjs/interceptors/lib/browser/chunk-2CAGU4FT.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/@mswjs/interceptors/lib/browser/chunk-2CAGU4FT.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/@mswjs/interceptors/lib/browser/chunk-2CAGU4FT.js
clapton-0.0.22 lib/clapton/javascripts/node_modules/@mswjs/interceptors/lib/browser/chunk-2CAGU4FT.js
clapton-0.0.21 lib/clapton/javascripts/node_modules/@mswjs/interceptors/lib/browser/chunk-2CAGU4FT.js
clapton-0.0.20 lib/clapton/javascripts/node_modules/@mswjs/interceptors/lib/browser/chunk-2CAGU4FT.js
clapton-0.0.19 lib/clapton/javascripts/node_modules/@mswjs/interceptors/lib/browser/chunk-2CAGU4FT.js
clapton-0.0.18 lib/clapton/javascripts/node_modules/@mswjs/interceptors/lib/browser/chunk-2CAGU4FT.js
clapton-0.0.17 lib/clapton/javascripts/node_modules/@mswjs/interceptors/lib/browser/chunk-2CAGU4FT.js
clapton-0.0.16 lib/clapton/javascripts/node_modules/@mswjs/interceptors/lib/browser/chunk-2CAGU4FT.js
clapton-0.0.15 lib/clapton/javascripts/node_modules/@mswjs/interceptors/lib/browser/chunk-2CAGU4FT.js
clapton-0.0.14 lib/clapton/javascripts/node_modules/@mswjs/interceptors/lib/browser/chunk-2CAGU4FT.js
clapton-0.0.13 lib/clapton/javascripts/node_modules/@mswjs/interceptors/lib/browser/chunk-2CAGU4FT.js
clapton-0.0.12 lib/clapton/javascripts/node_modules/@mswjs/interceptors/lib/browser/chunk-2CAGU4FT.js
clapton-0.0.11 lib/clapton/javascripts/node_modules/@mswjs/interceptors/lib/browser/chunk-2CAGU4FT.js
clapton-0.0.10 lib/clapton/javascripts/node_modules/@mswjs/interceptors/lib/browser/chunk-2CAGU4FT.js
clapton-0.0.9 lib/clapton/javascripts/node_modules/@mswjs/interceptors/lib/browser/chunk-2CAGU4FT.js
clapton-0.0.8 lib/clapton/javascripts/node_modules/@mswjs/interceptors/lib/browser/chunk-2CAGU4FT.js
clapton-0.0.7 lib/clapton/javascripts/node_modules/@mswjs/interceptors/lib/browser/chunk-2CAGU4FT.js