Skip to content

urlMatches

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/apps/api/src/tours/tour-targeting.ts

Does url satisfy the rule list? No rules (absent or empty) → match ALL pages. Rules are OR-ed. Rule values starting with '/' are path rules (compared against pathname+search); anything else is compared against the full normalized URL. An invalid regex never matches (and never throws).

Signature

ts
function urlMatches(rules: UrlRule[] | undefined | null, url: string): boolean

Parameters

NameType
rules`UrlRule[]
urlstring

Returns: boolean

Was this page helpful?

Download as PDF