zibri
    Preparing search index...
    • Applies a regex replacement to the given text, skipping string literals and comments. Prevents accidental renaming of identifiers that appear inside strings or comments.

      Parameters

      • text: string

        The text to apply the replacement to.

      • pattern: RegExp

        The pattern to match. Must have the global flag set.

      • replacement: string | ((...args: string[]) => string)

        The replacement string.

      Returns string

      The text with replacements applied.