UNPKG

@rpearce/flexible-string-replace

Version:

🧶 Safely replace any part of a string with anything. Example: useful for replacing substrings with JSX in React

3 lines (2 loc) • 202 B
export default function flexibleStringReplace(pattern: string | RegExp, replacer: string | ((...args: any[]) => any), // eslint-disable-line @typescript-eslint/no-explicit-any str: string): string[];