getRulesForUrl function infrastructure exported ✓ 100.0%
Last updated: 2026-02-24T21:07:57.583Z
Metrics
LOC: 6
Complexity: 1
Params: 1
Coverage: 100.0% (4/4 lines, 1x executed)
Signature
getRulesForUrl(url: string): : Promise<FieldRule[]>
Summary
Retrieves all rules whose urlPattern matches the given URL, sorted by priority (highest first).
Tags
#@param url - The page URL to match against
Source Code
export async function getRulesForUrl(url: string): Promise<FieldRule[]> {
const rules = await getRules();
return rules
.filter((rule) => matchUrlPattern(url, rule.urlPattern))
.sort((a, b) => b.priority - a.priority);
}
Dependencies (Outgoing)
| Target | Type |
|---|---|
| getRules | calls |
Impact (Incoming)
| Source | Type |
|---|---|
| generateDateForField | uses |