MCPcopy
hub / github.com/codeceptjs/CodeceptJS / matchUrl

Function matchUrl

lib/utils/pluginParser.js:129–132  ·  view source on GitHub ↗
(currentUrl, pattern)

Source from the content-addressed store, hash-verified

127 * Match a URL string against a glob-style pattern (supports `*` wildcards).
128 */
129export function matchUrl(currentUrl, pattern) {
130 if (!pattern || !currentUrl) return false
131 return patternToRegex(pattern).test(currentUrl)
132}
133
134function patternToRegex(pattern) {
135 const escaped = pattern.replace(/[.+?^${}()|[\]\\]/g, '\\$&')

Callers 4

aiTrace.jsFile · 0.90
wireOnUrlFunction · 0.90
initUrlModeFunction · 0.90
heal.jsFile · 0.90

Calls 1

patternToRegexFunction · 0.85

Tested by

no test coverage detected