Socket
Socket
Sign inDemoInstall

http-status-codes

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-status-codes - npm Package Compare versions

Comparing version 2.0.0-beta.2 to 2.0.0-beta.3

135

build/index.js

@@ -43,4 +43,6 @@ module.exports =

/******/ // Load entry module and return exports
/******/ return __webpack_require__(77);
/******/ return __webpack_require__(527);
/******/ };
/******/ // initialize runtime
/******/ runtime(__webpack_require__);
/******/

@@ -53,56 +55,9 @@ /******/ // run startup

/***/ 77:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
/***/ 527:
/***/ (function(__unusedmodule, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReasonPhrases = exports.StatusCodes = exports.getStatusCode = exports.getReasonPhrase = void 0;
var codes_1 = __webpack_require__(732);
Object.defineProperty(exports, "StatusCodes", { enumerable: true, get: function () { return codes_1.StatusCodes; } });
Object.defineProperty(exports, "ReasonPhrases", { enumerable: true, get: function () { return codes_1.ReasonPhrases; } });
/**
* Returns the reason phrase for the given status code.
* If the given status code does not exist, undefined is returned.
*
* @param {number|string} statusCode The HTTP status code
* @returns {string|undefined} The associated reason phrase (e.g. "Bad Request", "OK")
* */
function getReasonPhrase(statusCode) {
return codes_1.statusCodeToReasonPhrase[statusCode.toString()];
}
exports.getReasonPhrase = getReasonPhrase;
/**
* Returns the reason phrase for the given status code.
* If the given reason phrase does not exist, undefined is returned.
*
* @param {string} reasonPhrase The HTTP reason phrase (e.g. "Bad Request", "OK")
* @returns {string|undefined} The associated status code
* */
function getStatusCode(reasonPhrase) {
return codes_1.reasonPhraseToStatusCode[reasonPhrase];
}
exports.getStatusCode = getStatusCode;
// Default exports are deprecated, but maintained for v1 compatability
var defaultExports = {};
// Exporting constant to code directly to maintain compatability with v1
Object.entries(codes_1.StatusCodes).forEach(function (_a) {
var key = _a[0], value = _a[1];
defaultExports[key] = value;
});
// Exporting getStatusText and getStatusCode directly to maintain compatability with v1
defaultExports.getStatusText = getReasonPhrase;
defaultExports.getStatusCode = getStatusCode;
exports.default = defaultExports;
/***/ }),
/***/ 732:
/***/ (function(__unusedmodule, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.reasonPhraseToStatusCode = exports.statusCodeToReasonPhrase = exports.ReasonPhrases = exports.StatusCodes = void 0;
// CONCATENATED MODULE: ./build-tmp/codes.js
// Generated file. Do not edit

@@ -441,3 +396,3 @@ var StatusCodes;

StatusCodes[StatusCodes["USE_PROXY"] = 305] = "USE_PROXY";
})(StatusCodes = exports.StatusCodes || (exports.StatusCodes = {}));
})(StatusCodes || (StatusCodes = {}));
var ReasonPhrases;

@@ -775,4 +730,4 @@ (function (ReasonPhrases) {

ReasonPhrases["USE_PROXY"] = "Use Proxy";
})(ReasonPhrases = exports.ReasonPhrases || (exports.ReasonPhrases = {}));
exports.statusCodeToReasonPhrase = {
})(ReasonPhrases || (ReasonPhrases = {}));
const statusCodeToReasonPhrase = {
"202": "Accepted",

@@ -833,3 +788,3 @@ "502": "Bad Gateway",

};
exports.reasonPhraseToStatusCode = {
const reasonPhraseToStatusCode = {
"Accepted": 202,

@@ -891,5 +846,71 @@ "Bad Gateway": 502,

// CONCATENATED MODULE: ./build-tmp/index.js
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getReasonPhrase", function() { return getReasonPhrase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getStatusCode", function() { return getStatusCode; });
/* concated harmony reexport */ __webpack_require__.d(__webpack_exports__, "StatusCodes", function() { return StatusCodes; });
/* concated harmony reexport */ __webpack_require__.d(__webpack_exports__, "ReasonPhrases", function() { return ReasonPhrases; });
/* harmony export export */ __webpack_require__.d(__webpack_exports__, "default", function() { return build_tmp; });
/**
* Returns the reason phrase for the given status code.
* If the given status code does not exist, undefined is returned.
*
* @param {number|string} statusCode The HTTP status code
* @returns {string|undefined} The associated reason phrase (e.g. "Bad Request", "OK")
* */
function getReasonPhrase(statusCode) {
return statusCodeToReasonPhrase[statusCode.toString()];
}
/**
* Returns the reason phrase for the given status code.
* If the given reason phrase does not exist, undefined is returned.
*
* @param {string} reasonPhrase The HTTP reason phrase (e.g. "Bad Request", "OK")
* @returns {string|undefined} The associated status code
* */
function getStatusCode(reasonPhrase) {
return reasonPhraseToStatusCode[reasonPhrase];
}
// Default exports are deprecated, but maintained for v1 compatability
const defaultExports = {};
// Exporting constant to code directly to maintain compatability with v1
Object.entries(StatusCodes).forEach(([key, value]) => {
defaultExports[key] = value;
});
// Exporting getStatusText and getStatusCode directly to maintain compatability with v1
defaultExports.getStatusText = getReasonPhrase;
defaultExports.getStatusCode = getStatusCode;
/* harmony default export */ var build_tmp = (defaultExports);
/***/ })
/******/ });
/******/ },
/******/ function(__webpack_require__) { // webpackRuntimeModules
/******/ "use strict";
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ !function() {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ }();
/******/
/******/ /* webpack/runtime/define property getter */
/******/ !function() {
/******/ // define getter function for harmony exports
/******/ var hasOwnProperty = Object.prototype.hasOwnProperty;
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!hasOwnProperty.call(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/ }();
/******/
/******/ }
);
{
"name": "http-status-codes",
"version": "2.0.0-beta.2",
"version": "2.0.0-beta.3",
"description": "Constants enumerating the HTTP status codes. Based on the Java Apache HttpStatus API.",

@@ -5,0 +5,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc