{"version":3,"sources":["../src/typeguards/isHttpClientException.ts","../src/typeguards/isHttpServerException.ts","../src/typeguards/isHttpStatusCode.ts"],"names":["isHttpClientException","error","checkStatusCode","HttpClientException","isHttpServerException","HttpServerException","isHttpStatusCode","statusCode"],"mappings":"k1CAOO,IAAMA,EAAwB,CACnCC,CAAAA,CAIAC,CAAAA,CAAkB,IAAA,GAGhBD,aAAiBE,CAAAA,GAChB,CAACD,CAAAA,EAAoBD,CAAAA,CAAM,WAAa,GAAA,EAAOA,CAAAA,CAAM,WAAa,GAAA,ECThE,IAAMG,EAAwB,CACnCH,CAAAA,CAIAC,CAAAA,CAAkB,IAAA,GAGhBD,aAAiBI,CAAAA,GAChB,CAACH,GAAoBD,CAAAA,CAAM,UAAA,CAAa,KAAOA,CAAAA,CAAM,UAAA,CAAa,GAAA,ECZhE,IAAMK,EAAoBC,CAAAA,EACxB,OAAOA,GAAe,QAAA,EAAYA,CAAAA,CAAa,IAAMA,CAAAA,CAAa","file":"index.mjs","sourcesContent":["import { HttpClientException } from '../base/HttpClientException';\n\n/**\n * Test whether a value is an instanceof HttpClientException\n * and its statusCode is in the 4xx range when the parameter\n * checkStatusCode is true (enabled by default).\n */\nexport const isHttpClientException = (\n  error: unknown,\n  /**\n   * Ensure statusCode is in the client range [>=400, <500], true by default\n   */\n  checkStatusCode = true\n): error is HttpClientException => {\n  return (\n    error instanceof HttpClientException &&\n    (!checkStatusCode || (error.statusCode > 399 && error.statusCode < 500))\n  );\n};\n","import { HttpServerException } from '../base/HttpServerException';\n\n/**\n * Test whether a value is an instanceof HttpServerException\n * and its statusCode is in the 5xx range when the parameter\n * checkStatusCode is true (enabled by default).\n */\nexport const isHttpServerException = (\n  error: unknown,\n  /**\n   * Ensure statusCode is in the server range [>=500, <600], true by default\n   */\n  checkStatusCode = true\n): error is HttpServerException => {\n  return (\n    error instanceof HttpServerException &&\n    (!checkStatusCode || (error.statusCode > 499 && error.statusCode < 600))\n  );\n};\n","/**\n * Check if the provided value is a valid http status code > 99 and <600\n * @see isHttpErrorStatusCode to ensure error range [4xx,5xx]\n */\nexport const isHttpStatusCode = (statusCode: unknown): statusCode is number => {\n  return typeof statusCode === 'number' && statusCode > 99 && statusCode < 600;\n};\n"]}