mirror of
https://github.com/swc-project/swc.git
synced 2024-12-21 12:41:54 +03:00
f8aa0509ce
swc_bundler: - Prevent infinite recursions. (#1963)
127 lines
5.3 KiB
TypeScript
127 lines
5.3 KiB
TypeScript
// Loaded from https://deno.land/x/status@0.1.0/maps.ts
|
|
|
|
|
|
// Copyright 2020 Filippo Rossi. All rights reserved. MIT license.
|
|
|
|
import * as codes from "./codes.ts";
|
|
|
|
/**
|
|
* Mapping all status codes to status phrases.
|
|
*/
|
|
export const STATUS_MESSAGES: { [key: number]: string } = {
|
|
[codes.ACCEPTED]: "ACCEPTED",
|
|
[codes.BAD_GATEWAY]: "BAD_GATEWAY",
|
|
[codes.BAD_REQUEST]: "BAD_REQUEST",
|
|
[codes.CONFLICT]: "CONFLICT",
|
|
[codes.CONTINUE]: "CONTINUE",
|
|
[codes.CREATED]: "CREATED",
|
|
[codes.EXPECTATION_FAILED]: "EXPECTATION_FAILED",
|
|
[codes.FAILED_DEPENDENCY]: "FAILED_DEPENDENCY",
|
|
[codes.FORBIDDEN]: "FORBIDDEN",
|
|
[codes.GATEWAY_TIMEOUT]: "GATEWAY_TIMEOUT",
|
|
[codes.GONE]: "GONE",
|
|
[codes.HTTP_VERSION_NOT_SUPPORTED]: "HTTP_VERSION_NOT_SUPPORTED",
|
|
[codes.IM_A_TEAPOT]: "IM_A_TEAPOT",
|
|
[codes.INSUFFICIENT_SPACE_ON_RESOURCE]: "INSUFFICIENT_SPACE_ON_RESOURCE",
|
|
[codes.INSUFFICIENT_STORAGE]: "INSUFFICIENT_STORAGE",
|
|
[codes.INTERNAL_SERVER_ERROR]: "INTERNAL_SERVER_ERROR",
|
|
[codes.LENGTH_REQUIRED]: "LENGTH_REQUIRED",
|
|
[codes.LOCKED]: "LOCKED",
|
|
[codes.METHOD_FAILURE]: "METHOD_FAILURE",
|
|
[codes.METHOD_NOT_ALLOWED]: "METHOD_NOT_ALLOWED",
|
|
[codes.MOVED_PERMANENTLY]: "MOVED_PERMANENTLY",
|
|
[codes.MOVED_TEMPORARILY]: "MOVED_TEMPORARILY",
|
|
[codes.MULTI_STATUS]: "MULTI_STATUS",
|
|
[codes.MULTIPLE_CHOICES]: "MULTIPLE_CHOICES",
|
|
[codes.NETWORK_AUTHENTICATION_REQUIRED]: "NETWORK_AUTHENTICATION_REQUIRED",
|
|
[codes.NO_CONTENT]: "NO_CONTENT",
|
|
[codes.NON_AUTHORITATIVE_INFORMATION]: "NON_AUTHORITATIVE_INFORMATION",
|
|
[codes.NOT_ACCEPTABLE]: "NOT_ACCEPTABLE",
|
|
[codes.NOT_FOUND]: "NOT_FOUND",
|
|
[codes.NOT_IMPLEMENTED]: "NOT_IMPLEMENTED",
|
|
[codes.NOT_MODIFIED]: "NOT_MODIFIED",
|
|
[codes.OK]: "OK",
|
|
[codes.PARTIAL_CONTENT]: "PARTIAL_CONTENT",
|
|
[codes.PAYMENT_REQUIRED]: "PAYMENT_REQUIRED",
|
|
[codes.PERMANENT_REDIRECT]: "PERMANENT_REDIRECT",
|
|
[codes.PRECONDITION_FAILED]: "PRECONDITION_FAILED",
|
|
[codes.PRECONDITION_REQUIRED]: "PRECONDITION_REQUIRED",
|
|
[codes.PROCESSING]: "PROCESSING",
|
|
[codes.PROXY_AUTHENTICATION_REQUIRED]: "PROXY_AUTHENTICATION_REQUIRED",
|
|
[codes.REQUEST_HEADER_FIELDS_TOO_LARGE]: "REQUEST_HEADER_FIELDS_TOO_LARGE",
|
|
[codes.REQUEST_TIMEOUT]: "REQUEST_TIMEOUT",
|
|
[codes.REQUEST_TOO_LONG]: "REQUEST_TOO_LONG",
|
|
[codes.REQUEST_URI_TOO_LONG]: "REQUEST_URI_TOO_LONG",
|
|
[codes.REQUESTED_RANGE_NOT_SATISFIABLE]: "REQUESTED_RANGE_NOT_SATISFIABLE",
|
|
[codes.RESET_CONTENT]: "RESET_CONTENT",
|
|
[codes.SEE_OTHER]: "SEE_OTHER",
|
|
[codes.SERVICE_UNAVAILABLE]: "SERVICE_UNAVAILABLE",
|
|
[codes.SWITCHING_PROTOCOLS]: "SWITCHING_PROTOCOLS",
|
|
[codes.TEMPORARY_REDIRECT]: "TEMPORARY_REDIRECT",
|
|
[codes.TOO_MANY_REQUESTS]: "TOO_MANY_REQUESTS",
|
|
[codes.UNAUTHORIZED]: "UNAUTHORIZED",
|
|
[codes.UNPROCESSABLE_ENTITY]: "UNPROCESSABLE_ENTITY",
|
|
[codes.UNSUPPORTED_MEDIA_TYPE]: "UNSUPPORTED_MEDIA_TYPE",
|
|
[codes.USE_PROXY]: "USE_PROXY",
|
|
};
|
|
|
|
/**
|
|
* Mapping all status phrases to status codes.
|
|
*/
|
|
export const STATUS_CODES: { [key: string]: number } = {
|
|
"ACCEPTED": codes.ACCEPTED,
|
|
"BAD_GATEWAY": codes.BAD_GATEWAY,
|
|
"BAD_REQUEST": codes.BAD_REQUEST,
|
|
"CONFLICT": codes.CONFLICT,
|
|
"CONTINUE": codes.CONTINUE,
|
|
"CREATED": codes.CREATED,
|
|
"EXPECTATION_FAILED": codes.EXPECTATION_FAILED,
|
|
"FAILED_DEPENDENCY": codes.FAILED_DEPENDENCY,
|
|
"FORBIDDEN": codes.FORBIDDEN,
|
|
"GATEWAY_TIMEOUT": codes.GATEWAY_TIMEOUT,
|
|
"GONE": codes.GONE,
|
|
"HTTP_VERSION_NOT_SUPPORTED": codes.HTTP_VERSION_NOT_SUPPORTED,
|
|
"IM_A_TEAPOT": codes.IM_A_TEAPOT,
|
|
"INSUFFICIENT_SPACE_ON_RESOURCE": codes.INSUFFICIENT_SPACE_ON_RESOURCE,
|
|
"INSUFFICIENT_STORAGE": codes.INSUFFICIENT_STORAGE,
|
|
"INTERNAL_SERVER_ERROR": codes.INTERNAL_SERVER_ERROR,
|
|
"LENGTH_REQUIRED": codes.LENGTH_REQUIRED,
|
|
"LOCKED": codes.LOCKED,
|
|
"METHOD_FAILURE": codes.METHOD_FAILURE,
|
|
"METHOD_NOT_ALLOWED": codes.METHOD_NOT_ALLOWED,
|
|
"MOVED_PERMANENTLY": codes.MOVED_PERMANENTLY,
|
|
"MOVED_TEMPORARILY": codes.MOVED_TEMPORARILY,
|
|
"MULTI_STATUS": codes.MULTI_STATUS,
|
|
"MULTIPLE_CHOICES": codes.MULTIPLE_CHOICES,
|
|
"NETWORK_AUTHENTICATION_REQUIRED": codes.NETWORK_AUTHENTICATION_REQUIRED,
|
|
"NO_CONTENT": codes.NO_CONTENT,
|
|
"NON_AUTHORITATIVE_INFORMATION": codes.NON_AUTHORITATIVE_INFORMATION,
|
|
"NOT_ACCEPTABLE": codes.NOT_ACCEPTABLE,
|
|
"NOT_FOUND": codes.NOT_FOUND,
|
|
"NOT_IMPLEMENTED": codes.NOT_IMPLEMENTED,
|
|
"NOT_MODIFIED": codes.NOT_MODIFIED,
|
|
"OK": codes.OK,
|
|
"PARTIAL_CONTENT": codes.PARTIAL_CONTENT,
|
|
"PAYMENT_REQUIRED": codes.PAYMENT_REQUIRED,
|
|
"PERMANENT_REDIRECT": codes.PERMANENT_REDIRECT,
|
|
"PRECONDITION_FAILED": codes.PRECONDITION_FAILED,
|
|
"PRECONDITION_REQUIRED": codes.PRECONDITION_REQUIRED,
|
|
"PROCESSING": codes.PROCESSING,
|
|
"PROXY_AUTHENTICATION_REQUIRED": codes.PROXY_AUTHENTICATION_REQUIRED,
|
|
"REQUEST_HEADER_FIELDS_TOO_LARGE": codes.REQUEST_HEADER_FIELDS_TOO_LARGE,
|
|
"REQUEST_TIMEOUT": codes.REQUEST_TIMEOUT,
|
|
"REQUEST_TOO_LONG": codes.REQUEST_TOO_LONG,
|
|
"REQUEST_URI_TOO_LONG": codes.REQUEST_URI_TOO_LONG,
|
|
"REQUESTED_RANGE_NOT_SATISFIABLE": codes.REQUESTED_RANGE_NOT_SATISFIABLE,
|
|
"RESET_CONTENT": codes.RESET_CONTENT,
|
|
"SEE_OTHER": codes.SEE_OTHER,
|
|
"SERVICE_UNAVAILABLE": codes.SERVICE_UNAVAILABLE,
|
|
"SWITCHING_PROTOCOLS": codes.SWITCHING_PROTOCOLS,
|
|
"TEMPORARY_REDIRECT": codes.TEMPORARY_REDIRECT,
|
|
"TOO_MANY_REQUESTS": codes.TOO_MANY_REQUESTS,
|
|
"UNAUTHORIZED": codes.UNAUTHORIZED,
|
|
"UNPROCESSABLE_ENTITY": codes.UNPROCESSABLE_ENTITY,
|
|
"UNSUPPORTED_MEDIA_TYPE": codes.UNSUPPORTED_MEDIA_TYPE,
|
|
"USE_PROXY": codes.USE_PROXY,
|
|
};
|