(value)
| 31 | ] |
| 32 | |
| 33 | const 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 | |
| 42 | const createToken = (name, value, isGlobal) => { |
| 43 | const safe = makeSafeRegex(value) |