{"version":3,"file":"matcher.mjs","sources":["../../src/routes/matcher.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\n\nimport type { MatcherRule } from './types';\n\n/**\n * Class responsible for matching routes based on provided rules.\n */\nexport class RouteMatcher {\n /**\n * Array of rules to match routes against.\n */\n private readonly _rules: MatcherRule[];\n\n /**\n * @param rules - A list of matcher rules to apply. Defaults to an empty array.\n */\n constructor(rules: MatcherRule[] = []) {\n this._rules = rules;\n }\n\n /**\n * Checks if a given route matches all provided rules.\n *\n * Exits early if any rule fails.\n *\n * @param route - The route to check.\n * @returns `true` if the route satisfies all rules, otherwise `false`.\n */\n match(route: Core.Route): boolean {\n return this._rules.every((rule) => rule(route));\n }\n}\n"],"names":["RouteMatcher","match","route","_rules","every","rule","constructor","rules"],"mappings":"AAIA;;AAEC,IACM,MAAMA,YAAAA,CAAAA;AAaX;;;;;;;MAQAC,KAAAA,CAAMC,KAAiB,EAAW;QAChC,OAAO,IAAI,CAACC,MAAM,CAACC,KAAK,CAAC,CAACC,OAASA,IAAKH,CAAAA,KAAAA,CAAAA,CAAAA;AAC1C;AAjBA;;MAGAI,WAAAA,CAAYC,KAAuB,GAAA,EAAE,CAAE;QACrC,IAAI,CAACJ,MAAM,GAAGI,KAAAA;AAChB;AAaF;;;;"}