* Same as `s.replace`, but replace all matched strings instead of just one.
(searchValue: string | RegExp, replacement: string | ReplacementFunction)
| 1235 | * Same as `s.replace`, but replace all matched strings instead of just one. |
| 1236 | */ |
| 1237 | replaceAll(searchValue: string | RegExp, replacement: string | ReplacementFunction): this { |
| 1238 | if (typeof searchValue === 'string') { |
| 1239 | return this._replaceAllString(searchValue, replacement) |
| 1240 | } |
| 1241 | |
| 1242 | if (!searchValue.global) { |
| 1243 | throw new MagicStringError('replaceAll() requires a global RegExp') |
| 1244 | } |
| 1245 | |
| 1246 | return this._replaceRegexp(searchValue, replacement) |
| 1247 | } |
| 1248 | } |
no test coverage detected