MCPcopy Index your code
hub / github.com/npm/node-semver / makeSafeRegex

Function makeSafeRegex

internal/re.js:33–40  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

31]
32
33const makeSafeRegex = (value) => {
34 for (const [token, max] of safeRegexReplacements) {
35 value = value
36 .split(`${token}*`).join(`${token}{0,${max}}`)
37 .split(`${token}+`).join(`${token}{1,${max}}`)
38 }
39 return value
40}
41
42const createToken = (name, value, isGlobal) => {
43 const safe = makeSafeRegex(value)

Callers 1

createTokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected