* Same as `s.replace`, but replace all matched strings instead of just one.
(searchValue: string | RegExp, replacement: string | ReplacementFunction)
| 1476 | * Same as `s.replace`, but replace all matched strings instead of just one. |
| 1477 | */ |
| 1478 | replaceAll(searchValue: string | RegExp, replacement: string | ReplacementFunction): this { |
| 1479 | if (typeof searchValue === 'string') { |
| 1480 | return this._replaceAllString(searchValue, replacement) |
| 1481 | } |
| 1482 | |
| 1483 | if (!searchValue.global) { |
| 1484 | throw new MagicStringError('replaceAll() requires a global RegExp') |
| 1485 | } |
| 1486 | |
| 1487 | return this._replaceRegexp(searchValue, replacement) |
| 1488 | } |
| 1489 | } |
no test coverage detected