{"version":3,"file":"pathRegex.mjs","names":[],"sources":["../../src/utils/pathRegex.ts"],"sourcesContent":["import { createInvalidPathRegexError } from '../errors/pathRegex';\n\nexport function compilePathRegex(pathRegex?: string): RegExp | undefined {\n  if (pathRegex === undefined) return undefined;\n\n  try {\n    return new RegExp(pathRegex);\n  } catch (error) {\n    throw new Error(createInvalidPathRegexError(pathRegex, error));\n  }\n}\n\nexport function pathnameMatchesRegex(\n  pathname: string,\n  pathRegex?: RegExp\n): boolean {\n  return pathRegex?.test(pathname) ?? true;\n}\n"],"mappings":";;AAEA,SAAgB,iBAAiB,WAAwC;AACvE,KAAI,cAAc,KAAA,EAAW,QAAO,KAAA;AAEpC,KAAI;AACF,SAAO,IAAI,OAAO,UAAU;UACrB,OAAO;AACd,QAAM,IAAI,MAAM,4BAA4B,WAAW,MAAM,CAAC;;;AAIlE,SAAgB,qBACd,UACA,WACS;AACT,QAAO,WAAW,KAAK,SAAS,IAAI"}