apitally
Version:
Simple API monitoring & analytics for REST APIs built with Express, Fastify, Hono, Koa, and NestJS.
25 lines (24 loc) • 715 B
JavaScript
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
// src/common/utils.ts
function parseContentLength(contentLength) {
if (contentLength === void 0 || contentLength === null) {
return void 0;
}
if (typeof contentLength === "number") {
return contentLength;
}
if (typeof contentLength === "string") {
const parsed = parseInt(contentLength);
return isNaN(parsed) ? void 0 : parsed;
}
if (Array.isArray(contentLength)) {
return parseContentLength(contentLength[0]);
}
return void 0;
}
__name(parseContentLength, "parseContentLength");
export {
parseContentLength
};
//# sourceMappingURL=utils.js.map