This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.

17 lines
732 B
TypeScript
Raw Normal View History

2021-04-02 02:24:13 +03:00
import 'core-js/es/string/match-all';
/**
* @returns [`true`, modifiedContent: string] if replacement is successful, [`false`, originalContent] otherwise.
*/
export declare function replace(content: string, { replaceContent, replacePattern }: {
replaceContent: string;
replacePattern: string | RegExp;
}): [boolean, string];
/**
* Inserts content just before first occurrence of provided pattern.
* @returns [`true`, modifiedContent: string] if insertion is successful, [`false`, originalContent] otherwise.
*/
export declare function insert(content: string, { insertContent, insertPattern }: {
insertContent: string;
insertPattern: RegExp | string;
}, insertBeforeLastOccurrence?: boolean): [boolean, string];