* Same as `s.replace`, but replace all matched strings instead of just one.
(searchValue: string | RegExp, replacement: string | ReplacementFunction)
| 1500 | * Same as `s.replace`, but replace all matched strings instead of just one. |
| 1501 | */ |
| 1502 | replaceAll(searchValue: string | RegExp, replacement: string | ReplacementFunction): this { |
| 1503 | if (typeof searchValue === 'string') { |
| 1504 | return this._replaceAllString(searchValue, replacement) |
| 1505 | } |
| 1506 | |
| 1507 | if (!searchValue.global) { |
| 1508 | throw new MagicStringError('replaceAll() requires a global RegExp') |
| 1509 | } |
| 1510 | |
| 1511 | return this._replaceRegexp(searchValue, replacement) |
| 1512 | } |
| 1513 | } |
no test coverage detected