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)

graph LR getRulesForUrl["getRulesForUrl"] getRules["getRules"] getRulesForUrl -->|calls| getRules style getRulesForUrl fill:#dbeafe,stroke:#2563eb,stroke-width:2px click getRulesForUrl "2b935c6ef7eab8ce.html" click getRules "69aeb172cce4aa1c.html"
TargetType
getRules calls

Impact (Incoming)

graph LR getRulesForUrl["getRulesForUrl"] generateDateForField["generateDateForField"] generateDateForField -->|uses| getRulesForUrl style getRulesForUrl fill:#dbeafe,stroke:#2563eb,stroke-width:2px click getRulesForUrl "2b935c6ef7eab8ce.html" click generateDateForField "a214011e5ced5989.html"
SourceType
generateDateForField uses