(input)
| 54 | config.retry.condition = parseRegexp(config.retry.condition); |
| 55 | |
| 56 | function parseRegexp(input) { |
| 57 | // Parse input |
| 58 | const m = input.match(/(\/?)(.+)\1([a-z]*)/i); |
| 59 | |
| 60 | // match nothing |
| 61 | if (!m) return /$^/; |
| 62 | |
| 63 | // Invalid flags |
| 64 | if (m[3] && !/^(?!.*?(.).*?\1)[gmixXsuUAJ]+$/.test(m[3])) |
| 65 | return RegExp(input); |
| 66 | |
| 67 | // Create the regular expression |
| 68 | return new RegExp(m[2], m[3]); |
| 69 | } |
| 70 | })(); |
no test coverage detected