@nahkies/typescript-koa-runtime
Version:
Runtime package for code generated by @nahkies/openapi-code-generator using the typescript-koa template
11 lines (10 loc) • 469 B
JavaScript
//#region ../typescript-common-runtime/dist/esm/validation.mjs
function isMatch(status, match) {
return /^\d+$/.test(match) && String(status) === match || /^\d[xX]{2}$/.test(match) && String(status)[0] === match[0];
}
function findMatchingSchema(status, possibleResponses) {
for (const [match, schema] of possibleResponses) if (isMatch(status, match)) return schema;
}
//#endregion
export { findMatchingSchema as t };
//# sourceMappingURL=validation-Bk2toxs9.mjs.map