From da18686f0660bfbfaa26e5dbb6c9baa981fc246f Mon Sep 17 00:00:00 2001 From: Tal500 Date: Fri, 30 Sep 2022 12:53:14 +0300 Subject: [PATCH] fix: update typescript definition file to contain `replaceAll()` See https://github.com/Rich-Harris/magic-string/pull/222#issuecomment-1263355424 --- index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.d.ts b/index.d.ts index 0dca468..691e961 100644 --- a/index.d.ts +++ b/index.d.ts @@ -208,6 +208,10 @@ export default class MagicString { * String replacement with RegExp or string. */ replace(regex: RegExp | string, replacement: string | ((substring: string, ...args: any[]) => string)): MagicString; + /** + * Same as `s.replace`, but replace all matched strings instead of just one. + */ + replaceAll(regex: RegExp | string, replacement: string | ((substring: string, ...args: any[]) => string)): MagicString; lastChar(): string; lastLine(): string;