MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / patternToRegex

Function patternToRegex

lib/utils/pluginParser.js:134–138  ·  view source on GitHub ↗
(pattern)

Source from the content-addressed store, hash-verified

132}
133
134function patternToRegex(pattern) {
135 const escaped = pattern.replace(/[.+?^${}()|[\]\\]/g, '\\$&')
136 const regexStr = escaped.replace(/\*/g, '.*')
137 return new RegExp(regexStr)
138}
139
140/**
141 * Return the first available standard browser helper, or null.

Callers 1

matchUrlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected