MCPcopy
hub / github.com/mailvelope/mailvelope / matchPattern2RegEx

Function matchPattern2RegEx

src/lib/util.js:282–286  ·  view source on GitHub ↗
(matchPattern)

Source from the content-addressed store, hash-verified

280}
281
282export function matchPattern2RegEx(matchPattern) {
283 return new RegExp(
284 `^${matchPattern2RegExString(matchPattern)}$`
285 );
286}
287
288export function matchPattern2RegExString(matchPattern) {
289 return matchPattern.replace(/\./g, '\\.').replace(/^\*\\\./, '(\\w+(-\\w+)*\\.)*');

Callers 1

detectHostFunction · 0.90

Calls 1

matchPattern2RegExStringFunction · 0.85

Tested by

no test coverage detected