9s-fe-core
Version:
Core functionalities for authentication, configuration, and repository management.
32 lines (31 loc) • 981 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.HttpMethodDetail = exports.HttpMethod = void 0;
// HttpMethod.ts
var HttpMethod;
(function (HttpMethod) {
HttpMethod["GET"] = "GET";
HttpMethod["PUT"] = "PUT";
HttpMethod["POST"] = "POST";
HttpMethod["DELETE"] = "DELETE";
HttpMethod["PATCH"] = "PATCH";
})(HttpMethod || (exports.HttpMethod = HttpMethod = {}));
exports.HttpMethodDetail = {
fromString(value) {
const normalized = value.toLowerCase();
switch (normalized) {
case 'GET':
return HttpMethod.GET;
case 'PUT':
return HttpMethod.PUT;
case 'POST':
return HttpMethod.POST;
case 'DELETE':
return HttpMethod.DELETE;
case 'PATCH':
return HttpMethod.PATCH;
default:
throw new Error(`Unknown Http Method: ${value}`);
}
},
};