(regexp, str)
| 112 | * @returns {RegExpExecArray[]} matches |
| 113 | */ |
| 114 | const matchAll = (regexp, str) => { |
| 115 | /** @type {RegExpExecArray[]} */ |
| 116 | const result = []; |
| 117 | |
| 118 | /** @type {null | RegExpExecArray} */ |
| 119 | let match; |
| 120 | |
| 121 | while ((match = regexp.exec(str)) !== null) { |
| 122 | result.push(match); |
| 123 | } |
| 124 | return result; |
| 125 | }; |
| 126 | |
| 127 | /** |
| 128 | * Returns normalized url. |
no test coverage detected