Function applyCasePattern

    • Apply the case pattern of a source word to a target word. Detects all-upper / all-lower / title case, else falls back to position-wise applyCaseMask. Non-letter target chars always pass through unchanged (title-casing "-gng" → "-Gng").

      Parameters

      • target: string
      • mask: string

      Returns string