{"version":3,"sources":["../src/predicates.ts"],"names":["isIntegerInRange","code","minimum","maximum","isInformational","isSuccess","isRedirect","isClientError","isServerError","isError","getCategory"],"mappings":"aAEA,SAASA,CAAAA,CAAiBC,CAAAA,CAAcC,CAAAA,CAAiBC,CAAAA,CAA0B,CAC/E,OAAO,MAAA,CAAO,SAAA,CAAUF,CAAI,CAAA,EAAKA,CAAAA,EAAQC,CAAAA,EAAWD,GAAQE,CAChE,CAEO,SAASC,CAAAA,CAAgBH,CAAAA,CAAuB,CACnD,OAAOD,CAAAA,CAAiBC,CAAAA,CAAM,GAAA,CAAK,GAAG,CAC1C,CAEO,SAASI,CAAAA,CAAUJ,CAAAA,CAAuB,CAC7C,OAAOD,CAAAA,CAAiBC,CAAAA,CAAM,IAAK,GAAG,CAC1C,CAEO,SAASK,CAAAA,CAAWL,CAAAA,CAAuB,CAC9C,OAAOD,CAAAA,CAAiBC,CAAAA,CAAM,GAAA,CAAK,GAAG,CAC1C,CAEO,SAASM,CAAAA,CAAcN,CAAAA,CAAuB,CACjD,OAAOD,CAAAA,CAAiBC,CAAAA,CAAM,IAAK,GAAG,CAC1C,CAEO,SAASO,CAAAA,CAAcP,CAAAA,CAAuB,CACjD,OAAOD,CAAAA,CAAiBC,CAAAA,CAAM,GAAA,CAAK,GAAG,CAC1C,CAEO,SAASQ,CAAAA,CAAQR,CAAAA,CAAuB,CAC3C,OAAOD,CAAAA,CAAiBC,CAAAA,CAAM,GAAA,CAAK,GAAG,CAC1C,CAGO,SAASS,CAAAA,CAAYT,CAAAA,CAAyC,CACjE,OAAK,MAAA,CAAO,SAAA,CAAUA,CAAI,CAAA,CACtBG,CAAAA,CAAgBH,CAAI,CAAA,CAAU,KAAA,CAC9BI,CAAAA,CAAUJ,CAAI,CAAA,CAAU,KAAA,CACxBK,EAAWL,CAAI,CAAA,CAAU,KAAA,CACzBM,CAAAA,CAAcN,CAAI,CAAA,CAAU,KAAA,CAC5BO,CAAAA,CAAcP,CAAI,CAAA,CAAU,KAAA,CACzB,IAAA,CAN6B,IAOxC","file":"predicates.cjs","sourcesContent":["import type { HttpStatusCategory } from './types.js';\n\nfunction isIntegerInRange(code: number, minimum: number, maximum: number): boolean {\n    return Number.isInteger(code) && code >= minimum && code <= maximum;\n}\n\nexport function isInformational(code: number): boolean {\n    return isIntegerInRange(code, 100, 199);\n}\n\nexport function isSuccess(code: number): boolean {\n    return isIntegerInRange(code, 200, 299);\n}\n\nexport function isRedirect(code: number): boolean {\n    return isIntegerInRange(code, 300, 399);\n}\n\nexport function isClientError(code: number): boolean {\n    return isIntegerInRange(code, 400, 499);\n}\n\nexport function isServerError(code: number): boolean {\n    return isIntegerInRange(code, 500, 599);\n}\n\nexport function isError(code: number): boolean {\n    return isIntegerInRange(code, 400, 599);\n}\n\n/** Returns the numeric HTTP class, even when the specific code is unregistered. */\nexport function getCategory(code: number): HttpStatusCategory | null {\n    if (!Number.isInteger(code)) return null;\n    if (isInformational(code)) return '1xx';\n    if (isSuccess(code)) return '2xx';\n    if (isRedirect(code)) return '3xx';\n    if (isClientError(code)) return '4xx';\n    if (isServerError(code)) return '5xx';\n    return null;\n}\n"]}