@alanscodelog/utils
    Preparing search index...

    Function insert

    • Inserts a string into another at the given range or position.

      It will throw an ErrorW<{range: [number, number]}> if the (normalized*) range's start comes after the end.

      * Negative ranges are normalized to positive positions. If the range is still negative after the normalization this means it was out of bounds (e.g. before the string's start) and it's set to zero. So passing a range like [-20, -10] with a string of length 1, would not error, since it's just interpreted as [0, 0] (which is how slice already works).

      Parameters

      • str: string
      • intoStr: string
      • range: number | [number, number]

      Returns string