* Same as `s.replace`, but replace all matched strings instead of just one.
(searchValue: string | RegExp, replacement: string | ReplacementFunction)
| 1599 | * Same as `s.replace`, but replace all matched strings instead of just one. |
| 1600 | */ |
| 1601 | replaceAll(searchValue: string | RegExp, replacement: string | ReplacementFunction): this { |
| 1602 | if (typeof searchValue === 'string') { |
| 1603 | return this._replaceAllString(searchValue, replacement) |
| 1604 | } |
| 1605 | |
| 1606 | if (!searchValue.global) { |
| 1607 | throw new MagicStringError('replaceAll() requires a global RegExp') |
| 1608 | } |
| 1609 | |
| 1610 | return this._replaceRegexp(searchValue, replacement) |
| 1611 | } |
| 1612 | } |
no test coverage detected