http-response-status
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -5,2 +5,13 @@ # Changelog | ||
### [0.0.7](https://github.com/arnaud-zg/http-status/compare/v0.0.6...v0.0.7) (2019-10-13) | ||
### 🔧 Chore | ||
* **deps:** update dependency husky to v3.0.9 ([#26](https://github.com/arnaud-zg/http-status/issues/26)) ([cc0f6e5](https://github.com/arnaud-zg/http-status/commit/cc0f6e5)) | ||
* **deps:** update dependency pretty-quick to v2 ([#27](https://github.com/arnaud-zg/http-status/issues/27)) ([b2adc3b](https://github.com/arnaud-zg/http-status/commit/b2adc3b)) | ||
* **http:** use constant for http status ([#24](https://github.com/arnaud-zg/http-status/issues/24)) ([fb8d897](https://github.com/arnaud-zg/http-status/commit/fb8d897)) | ||
* **project:** remove pretty quick and add lint command ([#28](https://github.com/arnaud-zg/http-status/issues/28)) ([3956595](https://github.com/arnaud-zg/http-status/commit/3956595)) | ||
* **project:** reorder variable position ([#25](https://github.com/arnaud-zg/http-status/issues/25)) ([70016a0](https://github.com/arnaud-zg/http-status/commit/70016a0)) | ||
### [0.0.6](https://github.com/arnaud-zg/http-status/compare/v0.0.5...v0.0.6) (2019-10-09) | ||
@@ -7,0 +18,0 @@ |
export declare namespace NHttpHeaders { | ||
enum EHttpHeaders { | ||
ACCEPT_RANGES = "Accept-Ranges", | ||
ACCESS_CONTROL_ALLOW_CREDENTIALS = "Access-Control-Allow-Credentials", | ||
@@ -9,3 +10,2 @@ ACCESS_CONTROL_ALLOW_HEADERS = "Access-Control-Allow-Headers", | ||
ACCESS_CONTROL_MAX_AGE = "Access-Control-Max-Age", | ||
ACCEPT_RANGES = "Accept-Ranges", | ||
AGE = "Age", | ||
@@ -27,3 +27,2 @@ ALLOW = "Allow", | ||
CONTENT_SECURITY_POLICY = "X-Content-Security-Policy", | ||
X_WEBKIT_CSP = "Content-Security-Policy, X-Content-Security-Policy, X-Webkit-CSP", | ||
CONTENT_SECURITY_POLICY_REPORT_ONLY = "Content-Security-Policy-Report-Only", | ||
@@ -65,2 +64,3 @@ CONTENT_TYPE = "Content-Type", | ||
X_UA_COMPATIBLE = "X-UA-Compatible", | ||
X_WEBKIT_CSP = "Content-Security-Policy, X-Content-Security-Policy, X-Webkit-CSP", | ||
X_XSS_PROTECTION = "X-XSS-Protection" | ||
@@ -67,0 +67,0 @@ } |
@@ -7,2 +7,3 @@ 'use strict'; | ||
(function (EHttpHeaders) { | ||
EHttpHeaders["ACCEPT_RANGES"] = "Accept-Ranges"; | ||
EHttpHeaders["ACCESS_CONTROL_ALLOW_CREDENTIALS"] = "Access-Control-Allow-Credentials"; | ||
@@ -14,3 +15,2 @@ EHttpHeaders["ACCESS_CONTROL_ALLOW_HEADERS"] = "Access-Control-Allow-Headers"; | ||
EHttpHeaders["ACCESS_CONTROL_MAX_AGE"] = "Access-Control-Max-Age"; | ||
EHttpHeaders["ACCEPT_RANGES"] = "Accept-Ranges"; | ||
EHttpHeaders["AGE"] = "Age"; | ||
@@ -32,3 +32,2 @@ EHttpHeaders["ALLOW"] = "Allow"; | ||
EHttpHeaders["CONTENT_SECURITY_POLICY"] = "X-Content-Security-Policy"; | ||
EHttpHeaders["X_WEBKIT_CSP"] = "Content-Security-Policy, X-Content-Security-Policy, X-Webkit-CSP"; | ||
EHttpHeaders["CONTENT_SECURITY_POLICY_REPORT_ONLY"] = "Content-Security-Policy-Report-Only"; | ||
@@ -70,2 +69,3 @@ EHttpHeaders["CONTENT_TYPE"] = "Content-Type"; | ||
EHttpHeaders["X_UA_COMPATIBLE"] = "X-UA-Compatible"; | ||
EHttpHeaders["X_WEBKIT_CSP"] = "Content-Security-Policy, X-Content-Security-Policy, X-Webkit-CSP"; | ||
EHttpHeaders["X_XSS_PROTECTION"] = "X-XSS-Protection"; | ||
@@ -165,2 +165,7 @@ })(EHttpHeaders = NHttpHeaders.EHttpHeaders || (NHttpHeaders.EHttpHeaders = {})); | ||
var HTTP_STATUS_CLIENT_ERROR = 'ClientError'; | ||
var HTTP_STATUS_INFORMATIONAL = 'Informational'; | ||
var HTTP_STATUS_REDIRECTION = 'Redirection'; | ||
var HTTP_STATUS_SERVER_ERROR = 'ServerError'; | ||
var HTTP_STATUS_SUCCESS = 'Success'; | ||
var getHttpStatusName = function getHttpStatusName(httpStatusCode) { | ||
@@ -171,11 +176,11 @@ return exports.NHttpStatuses.EInformational[httpStatusCode] || exports.NHttpStatuses.ESuccess[httpStatusCode] || exports.NHttpStatuses.ERedirection[httpStatusCode] || exports.NHttpStatuses.ClientError[httpStatusCode] || exports.NHttpStatuses.EServerError[httpStatusCode]; | ||
if (Object.values(exports.NHttpStatuses.EInformational).indexOf(httpStatusCode) !== -1) { | ||
return 'Informational'; | ||
return HTTP_STATUS_INFORMATIONAL; | ||
} else if (Object.values(exports.NHttpStatuses.ESuccess).indexOf(httpStatusCode) !== -1) { | ||
return 'Success'; | ||
return HTTP_STATUS_SUCCESS; | ||
} else if (Object.values(exports.NHttpStatuses.ERedirection).indexOf(httpStatusCode) !== -1) { | ||
return 'Redirection'; | ||
return HTTP_STATUS_REDIRECTION; | ||
} else if (Object.values(exports.NHttpStatuses.ClientError).indexOf(httpStatusCode) !== -1) { | ||
return 'ClientError'; | ||
return HTTP_STATUS_CLIENT_ERROR; | ||
} else if (Object.values(exports.NHttpStatuses.EServerError).indexOf(httpStatusCode) !== -1) { | ||
return 'ServerError'; | ||
return HTTP_STATUS_SERVER_ERROR; | ||
} | ||
@@ -182,0 +187,0 @@ |
@@ -1,2 +0,2 @@ | ||
"use strict";var E,T,O,N,_,R,A,t;(E=(T=exports.NHttpHeaders||(exports.NHttpHeaders={})).EHttpHeaders||(T.EHttpHeaders={})).ACCESS_CONTROL_ALLOW_CREDENTIALS="Access-Control-Allow-Credentials",E.ACCESS_CONTROL_ALLOW_HEADERS="Access-Control-Allow-Headers",E.ACCESS_CONTROL_ALLOW_METHODS="Access-Control-Allow-Methods",E.ACCESS_CONTROL_ALLOW_ORIGIN="Access-Control-Allow-Origin",E.ACCESS_CONTROL_EXPOSE_HEADERS="Access-Control-Expose-Headers",E.ACCESS_CONTROL_MAX_AGE="Access-Control-Max-Age",E.ACCEPT_RANGES="Accept-Ranges",E.AGE="Age",E.ALLOW="Allow",E.ALTERNATE_PROTOCOL="Alternate-Protocol",E.CACHE_CONTROL="Cache-Control",E.CLIENT_DATE="Client-Date",E.CLIENT_PEER="Client-Peer",E.CLIENT_RESPONSE_NUM="Client-Response-Num",E.CONNECTION="Connection",E.CONTENT_DISPOSITION="Content-Disposition",E.CONTENT_ENCODING="Content-Encoding",E.CONTENT_LANGUAGE="Content-Language",E.CONTENT_LENGTH="Content-Length",E.CONTENT_LOCATION="Content-Location",E.CONTENT_MD5="Content-MD5",E.CONTENT_RANGE="Content-Range",E.CONTENT_SECURITY_POLICY="X-Content-Security-Policy",E.X_WEBKIT_CSP="Content-Security-Policy, X-Content-Security-Policy, X-Webkit-CSP",E.CONTENT_SECURITY_POLICY_REPORT_ONLY="Content-Security-Policy-Report-Only",E.CONTENT_TYPE="Content-Type",E.DATE="Date",E.ETAG="Etag",E.EXPIRES="Expires",E.HTTP="HTTP",E.KEEP_ALIVE="Keep-Alive",E.LAST_MODIFIED="Last-Modified",E.LINK="Link",E.LOCATION="Location",E.P3P="P3P",E.PRAGMA="Pragma",E.PROXY_AUTHENTICATE="Proxy-Authenticate",E.PROXY_CONNECTION="Proxy-Connection",E.REFRESH="Refresh",E.RETRY_AFTER="Retry-After",E.SERVER="Server",E.SET_COOKIE="Set-Cookie",E.STATUS="Status",E.STRICT_TRANSPORT_SECURITY="Strict-Transport-Security",E.TIMING_ALLOW_ORIGIN="Timing-Allow-Origin",E.TRAILER="Trailer",E.TRANSFER_ENCODING="Transfer-Encoding",E.UPGRADE="Upgrade",E.VARY="Vary",E.VIA="Via",E.WARNING="Warning",E.WWW_AUTHENTICATE="WWW-Authenticate",E.X_ASPNET_VERSION="X-Aspnet-Version",E.X_CONTENT_TYPE_OPTIONS="X-Content-Type-Options",E.X_FRAME_OPTIONS="X-Frame-Options",E.X_PERMITTED_CROSS_DOMAIN_POLICIES="X-Permitted-Cross-Domain-Policies",E.X_PINGBACK="X-Pingback",E.X_POWERED_BY="X-Powered-By",E.X_ROBOTS_TAG="X-Robots-Tag",E.X_UA_COMPATIBLE="X-UA-Compatible",E.X_XSS_PROTECTION="X-XSS-Protection",(A=(t=exports.NHttpStatuses||(exports.NHttpStatuses={})).EInformational||(t.EInformational={}))[A.CONTINUE=100]="CONTINUE",A[A.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",A[A.PROCESSING=102]="PROCESSING",(R=t.ESuccess||(t.ESuccess={}))[R.OK=200]="OK",R[R.CREATED=201]="CREATED",R[R.ACCEPTED=202]="ACCEPTED",R[R.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",R[R.NO_CONTENT=204]="NO_CONTENT",R[R.RESET_CONTENT=205]="RESET_CONTENT",R[R.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",R[R.MULTI_STATUS=207]="MULTI_STATUS",R[R.ALREADY_REPORTED=208]="ALREADY_REPORTED",R[R.IM_USED=226]="IM_USED",(_=t.ERedirection||(t.ERedirection={}))[_.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",_[_.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",_[_.FOUND=302]="FOUND",_[_.SEE_OTHER=303]="SEE_OTHER",_[_.NOT_MODIFIED=304]="NOT_MODIFIED",_[_.USE_PROXY=305]="USE_PROXY",_[_.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",_[_.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",(N=t.ClientError||(t.ClientError={}))[N.BAD_REQUEST=400]="BAD_REQUEST",N[N.UNAUTHORIZED=401]="UNAUTHORIZED",N[N.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",N[N.FORBIDDEN=403]="FORBIDDEN",N[N.NOT_FOUND=404]="NOT_FOUND",N[N.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",N[N.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",N[N.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",N[N.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",N[N.CONFLICT=409]="CONFLICT",N[N.GONE=410]="GONE",N[N.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",N[N.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",N[N.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",N[N.REQUEST_URI_TOO_LONG=414]="REQUEST_URI_TOO_LONG",N[N.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",N[N.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",N[N.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",N[N.I_M_A_TEAPOT=418]="I_M_A_TEAPOT",N[N.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",N[N.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",N[N.LOCKED=423]="LOCKED",N[N.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",N[N.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",N[N.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",N[N.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",N[N.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",N[N.CONNECTION_CLOSED_WITHOUT_RESPONSE=444]="CONNECTION_CLOSED_WITHOUT_RESPONSE",N[N.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",N[N.CLIENT_CLOSED_REQUEST=499]="CLIENT_CLOSED_REQUEST",(O=t.EServerError||(t.EServerError={}))[O.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",O[O.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",O[O.BAD_GATEWAY=502]="BAD_GATEWAY",O[O.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",O[O.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",O[O.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",O[O.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",O[O.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",O[O.LOOP_DETECTED=508]="LOOP_DETECTED",O[O.NOT_EXTENDED=510]="NOT_EXTENDED",O[O.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED",O[O.NETWORK_CONNECT_TIMEOUT_ERROR=599]="NETWORK_CONNECT_TIMEOUT_ERROR",exports.getHttpStatusCatgory=function(E){return-1!==Object.values(exports.NHttpStatuses.EInformational).indexOf(E)?"Informational":-1!==Object.values(exports.NHttpStatuses.ESuccess).indexOf(E)?"Success":-1!==Object.values(exports.NHttpStatuses.ERedirection).indexOf(E)?"Redirection":-1!==Object.values(exports.NHttpStatuses.ClientError).indexOf(E)?"ClientError":-1!==Object.values(exports.NHttpStatuses.EServerError).indexOf(E)?"ServerError":void 0},exports.getHttpStatusName=function(E){return exports.NHttpStatuses.EInformational[E]||exports.NHttpStatuses.ESuccess[E]||exports.NHttpStatuses.ERedirection[E]||exports.NHttpStatuses.ClientError[E]||exports.NHttpStatuses.EServerError[E]}; | ||
"use strict";var E,T,O,N,_,R,A,t;(E=(T=exports.NHttpHeaders||(exports.NHttpHeaders={})).EHttpHeaders||(T.EHttpHeaders={})).ACCEPT_RANGES="Accept-Ranges",E.ACCESS_CONTROL_ALLOW_CREDENTIALS="Access-Control-Allow-Credentials",E.ACCESS_CONTROL_ALLOW_HEADERS="Access-Control-Allow-Headers",E.ACCESS_CONTROL_ALLOW_METHODS="Access-Control-Allow-Methods",E.ACCESS_CONTROL_ALLOW_ORIGIN="Access-Control-Allow-Origin",E.ACCESS_CONTROL_EXPOSE_HEADERS="Access-Control-Expose-Headers",E.ACCESS_CONTROL_MAX_AGE="Access-Control-Max-Age",E.AGE="Age",E.ALLOW="Allow",E.ALTERNATE_PROTOCOL="Alternate-Protocol",E.CACHE_CONTROL="Cache-Control",E.CLIENT_DATE="Client-Date",E.CLIENT_PEER="Client-Peer",E.CLIENT_RESPONSE_NUM="Client-Response-Num",E.CONNECTION="Connection",E.CONTENT_DISPOSITION="Content-Disposition",E.CONTENT_ENCODING="Content-Encoding",E.CONTENT_LANGUAGE="Content-Language",E.CONTENT_LENGTH="Content-Length",E.CONTENT_LOCATION="Content-Location",E.CONTENT_MD5="Content-MD5",E.CONTENT_RANGE="Content-Range",E.CONTENT_SECURITY_POLICY="X-Content-Security-Policy",E.CONTENT_SECURITY_POLICY_REPORT_ONLY="Content-Security-Policy-Report-Only",E.CONTENT_TYPE="Content-Type",E.DATE="Date",E.ETAG="Etag",E.EXPIRES="Expires",E.HTTP="HTTP",E.KEEP_ALIVE="Keep-Alive",E.LAST_MODIFIED="Last-Modified",E.LINK="Link",E.LOCATION="Location",E.P3P="P3P",E.PRAGMA="Pragma",E.PROXY_AUTHENTICATE="Proxy-Authenticate",E.PROXY_CONNECTION="Proxy-Connection",E.REFRESH="Refresh",E.RETRY_AFTER="Retry-After",E.SERVER="Server",E.SET_COOKIE="Set-Cookie",E.STATUS="Status",E.STRICT_TRANSPORT_SECURITY="Strict-Transport-Security",E.TIMING_ALLOW_ORIGIN="Timing-Allow-Origin",E.TRAILER="Trailer",E.TRANSFER_ENCODING="Transfer-Encoding",E.UPGRADE="Upgrade",E.VARY="Vary",E.VIA="Via",E.WARNING="Warning",E.WWW_AUTHENTICATE="WWW-Authenticate",E.X_ASPNET_VERSION="X-Aspnet-Version",E.X_CONTENT_TYPE_OPTIONS="X-Content-Type-Options",E.X_FRAME_OPTIONS="X-Frame-Options",E.X_PERMITTED_CROSS_DOMAIN_POLICIES="X-Permitted-Cross-Domain-Policies",E.X_PINGBACK="X-Pingback",E.X_POWERED_BY="X-Powered-By",E.X_ROBOTS_TAG="X-Robots-Tag",E.X_UA_COMPATIBLE="X-UA-Compatible",E.X_WEBKIT_CSP="Content-Security-Policy, X-Content-Security-Policy, X-Webkit-CSP",E.X_XSS_PROTECTION="X-XSS-Protection",(A=(t=exports.NHttpStatuses||(exports.NHttpStatuses={})).EInformational||(t.EInformational={}))[A.CONTINUE=100]="CONTINUE",A[A.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",A[A.PROCESSING=102]="PROCESSING",(R=t.ESuccess||(t.ESuccess={}))[R.OK=200]="OK",R[R.CREATED=201]="CREATED",R[R.ACCEPTED=202]="ACCEPTED",R[R.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",R[R.NO_CONTENT=204]="NO_CONTENT",R[R.RESET_CONTENT=205]="RESET_CONTENT",R[R.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",R[R.MULTI_STATUS=207]="MULTI_STATUS",R[R.ALREADY_REPORTED=208]="ALREADY_REPORTED",R[R.IM_USED=226]="IM_USED",(_=t.ERedirection||(t.ERedirection={}))[_.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",_[_.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",_[_.FOUND=302]="FOUND",_[_.SEE_OTHER=303]="SEE_OTHER",_[_.NOT_MODIFIED=304]="NOT_MODIFIED",_[_.USE_PROXY=305]="USE_PROXY",_[_.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",_[_.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",(N=t.ClientError||(t.ClientError={}))[N.BAD_REQUEST=400]="BAD_REQUEST",N[N.UNAUTHORIZED=401]="UNAUTHORIZED",N[N.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",N[N.FORBIDDEN=403]="FORBIDDEN",N[N.NOT_FOUND=404]="NOT_FOUND",N[N.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",N[N.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",N[N.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",N[N.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",N[N.CONFLICT=409]="CONFLICT",N[N.GONE=410]="GONE",N[N.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",N[N.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",N[N.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",N[N.REQUEST_URI_TOO_LONG=414]="REQUEST_URI_TOO_LONG",N[N.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",N[N.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",N[N.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",N[N.I_M_A_TEAPOT=418]="I_M_A_TEAPOT",N[N.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",N[N.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",N[N.LOCKED=423]="LOCKED",N[N.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",N[N.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",N[N.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",N[N.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",N[N.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",N[N.CONNECTION_CLOSED_WITHOUT_RESPONSE=444]="CONNECTION_CLOSED_WITHOUT_RESPONSE",N[N.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",N[N.CLIENT_CLOSED_REQUEST=499]="CLIENT_CLOSED_REQUEST",(O=t.EServerError||(t.EServerError={}))[O.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",O[O.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",O[O.BAD_GATEWAY=502]="BAD_GATEWAY",O[O.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",O[O.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",O[O.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",O[O.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",O[O.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",O[O.LOOP_DETECTED=508]="LOOP_DETECTED",O[O.NOT_EXTENDED=510]="NOT_EXTENDED",O[O.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED",O[O.NETWORK_CONNECT_TIMEOUT_ERROR=599]="NETWORK_CONNECT_TIMEOUT_ERROR",exports.getHttpStatusCatgory=function(E){return-1!==Object.values(exports.NHttpStatuses.EInformational).indexOf(E)?"Informational":-1!==Object.values(exports.NHttpStatuses.ESuccess).indexOf(E)?"Success":-1!==Object.values(exports.NHttpStatuses.ERedirection).indexOf(E)?"Redirection":-1!==Object.values(exports.NHttpStatuses.ClientError).indexOf(E)?"ClientError":-1!==Object.values(exports.NHttpStatuses.EServerError).indexOf(E)?"ServerError":void 0},exports.getHttpStatusName=function(E){return exports.NHttpStatuses.EInformational[E]||exports.NHttpStatuses.ESuccess[E]||exports.NHttpStatuses.ERedirection[E]||exports.NHttpStatuses.ClientError[E]||exports.NHttpStatuses.EServerError[E]}; | ||
//# sourceMappingURL=http-response-status.cjs.production.min.js.map |
@@ -7,2 +7,3 @@ var NHttpHeaders; | ||
(function (EHttpHeaders) { | ||
EHttpHeaders["ACCEPT_RANGES"] = "Accept-Ranges"; | ||
EHttpHeaders["ACCESS_CONTROL_ALLOW_CREDENTIALS"] = "Access-Control-Allow-Credentials"; | ||
@@ -14,3 +15,2 @@ EHttpHeaders["ACCESS_CONTROL_ALLOW_HEADERS"] = "Access-Control-Allow-Headers"; | ||
EHttpHeaders["ACCESS_CONTROL_MAX_AGE"] = "Access-Control-Max-Age"; | ||
EHttpHeaders["ACCEPT_RANGES"] = "Accept-Ranges"; | ||
EHttpHeaders["AGE"] = "Age"; | ||
@@ -32,3 +32,2 @@ EHttpHeaders["ALLOW"] = "Allow"; | ||
EHttpHeaders["CONTENT_SECURITY_POLICY"] = "X-Content-Security-Policy"; | ||
EHttpHeaders["X_WEBKIT_CSP"] = "Content-Security-Policy, X-Content-Security-Policy, X-Webkit-CSP"; | ||
EHttpHeaders["CONTENT_SECURITY_POLICY_REPORT_ONLY"] = "Content-Security-Policy-Report-Only"; | ||
@@ -70,2 +69,3 @@ EHttpHeaders["CONTENT_TYPE"] = "Content-Type"; | ||
EHttpHeaders["X_UA_COMPATIBLE"] = "X-UA-Compatible"; | ||
EHttpHeaders["X_WEBKIT_CSP"] = "Content-Security-Policy, X-Content-Security-Policy, X-Webkit-CSP"; | ||
EHttpHeaders["X_XSS_PROTECTION"] = "X-XSS-Protection"; | ||
@@ -167,2 +167,7 @@ })(EHttpHeaders = NHttpHeaders.EHttpHeaders || (NHttpHeaders.EHttpHeaders = {})); | ||
var HTTP_STATUS_CLIENT_ERROR = 'ClientError'; | ||
var HTTP_STATUS_INFORMATIONAL = 'Informational'; | ||
var HTTP_STATUS_REDIRECTION = 'Redirection'; | ||
var HTTP_STATUS_SERVER_ERROR = 'ServerError'; | ||
var HTTP_STATUS_SUCCESS = 'Success'; | ||
var getHttpStatusName = function getHttpStatusName(httpStatusCode) { | ||
@@ -173,11 +178,11 @@ return NHttpStatuses.EInformational[httpStatusCode] || NHttpStatuses.ESuccess[httpStatusCode] || NHttpStatuses.ERedirection[httpStatusCode] || NHttpStatuses.ClientError[httpStatusCode] || NHttpStatuses.EServerError[httpStatusCode]; | ||
if (Object.values(NHttpStatuses.EInformational).indexOf(httpStatusCode) !== -1) { | ||
return 'Informational'; | ||
return HTTP_STATUS_INFORMATIONAL; | ||
} else if (Object.values(NHttpStatuses.ESuccess).indexOf(httpStatusCode) !== -1) { | ||
return 'Success'; | ||
return HTTP_STATUS_SUCCESS; | ||
} else if (Object.values(NHttpStatuses.ERedirection).indexOf(httpStatusCode) !== -1) { | ||
return 'Redirection'; | ||
return HTTP_STATUS_REDIRECTION; | ||
} else if (Object.values(NHttpStatuses.ClientError).indexOf(httpStatusCode) !== -1) { | ||
return 'ClientError'; | ||
return HTTP_STATUS_CLIENT_ERROR; | ||
} else if (Object.values(NHttpStatuses.EServerError).indexOf(httpStatusCode) !== -1) { | ||
return 'ServerError'; | ||
return HTTP_STATUS_SERVER_ERROR; | ||
} | ||
@@ -184,0 +189,0 @@ |
export declare type THttpStatusCodeCatagory = ReturnType<typeof getHttpStatusCatgory>; | ||
export declare type THttpStatusName = ReturnType<typeof getHttpStatusName>; | ||
export declare const getHttpStatusName: (httpStatusCode: number) => string; | ||
export declare const getHttpStatusCatgory: (httpStatusCode: number) => "Informational" | "Success" | "Redirection" | "ClientError" | "ServerError" | undefined; | ||
export declare const getHttpStatusCatgory: (httpStatusCode: number) => "ClientError" | "Informational" | "Redirection" | "ServerError" | "Success" | undefined; |
{ | ||
"name": "http-response-status", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"main": "dist/index.js", | ||
@@ -12,2 +12,3 @@ "module": "dist/http-status.esm.js", | ||
"build": "tsdx build", | ||
"lint": "tsdx lint", | ||
"release": "standard-version", | ||
@@ -22,3 +23,3 @@ "start": "tsdx watch", | ||
"hooks": { | ||
"pre-commit": "pretty-quick --staged" | ||
"pre-commit": "tsdx lint" | ||
} | ||
@@ -35,5 +36,4 @@ }, | ||
"codecov": "3.6.1", | ||
"husky": "3.0.8", | ||
"husky": "3.0.9", | ||
"prettier": "1.18.2", | ||
"pretty-quick": "1.11.1", | ||
"standard-version": "7.0.0", | ||
@@ -40,0 +40,0 @@ "tsdx": "0.9.3", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71648
8
522