@thisisagile/easy
Version:
Straightforward library for building domain-driven microservice architectures
31 lines (29 loc) • 972 B
JavaScript
import {
Enum
} from "./chunk-JVDKV5HE.mjs";
import {
asString
} from "./chunk-BDA5LB4S.mjs";
import {
ofGet
} from "./chunk-SJGQU3OG.mjs";
// src/http/ContentType.ts
import formUrlEncoded from "form-urlencoded";
var ContentType = class _ContentType extends Enum {
constructor(name, type, encoder = (b) => asString(b)) {
super(name, type);
this.type = type;
this.encoder = encoder;
}
static Form = new _ContentType("form", "application/x-www-form-urlencoded", (b) => formUrlEncoded(b));
static Json = new _ContentType("json", "application/json", (b) => b);
static RawJson = new _ContentType("rawJson", "application/json", (b) => b);
static Stream = new _ContentType("stream", "application/octet-stream");
static Text = new _ContentType("text", "text/plain");
static Xml = new _ContentType("xml", "application/xml");
encode = (body) => ofGet(this.encoder, body);
};
export {
ContentType
};
//# sourceMappingURL=chunk-RDLH6MXX.mjs.map