* Same as `s.replace`, but replace all matched strings instead of just one.
(searchValue: string | RegExp, replacement: string | ReplacementFunction)
| 1299 | * Same as `s.replace`, but replace all matched strings instead of just one. |
| 1300 | */ |
| 1301 | replaceAll(searchValue: string | RegExp, replacement: string | ReplacementFunction): this { |
| 1302 | if (typeof searchValue === 'string') { |
| 1303 | return this._replaceAllString(searchValue, replacement) |
| 1304 | } |
| 1305 | |
| 1306 | if (!searchValue.global) { |
| 1307 | throw new MagicStringError('replaceAll() requires a global RegExp') |
| 1308 | } |
| 1309 | |
| 1310 | return this._replaceRegexp(searchValue, replacement) |
| 1311 | } |
| 1312 | } |
no test coverage detected