platform-bible-utils
    Preparing search index...

    Function padStart

    • This function mirrors the padStart function from the JavaScript Standard String object. It operates on grapheme clusters instead of UTF-16 code units.

      Pads the string with another string (multiple times, if needed) until the result is targetLength grapheme clusters long. The padding is applied at the start.

      Parameters

      • string: string

        String to add padding to

      • targetLength: number

        Length of the result, in grapheme clusters. If it is less than or equal to stringLength(string), the string is returned as is

      • OptionalpadString: string

        The string to pad with, truncated to fit targetLength. Default is " "

      Returns string

      String with the appropriate padding at the start

      RangeError when targetLength exceeds MAX_PADDING_LENGTH and padding would actually be added. This ceiling is lower than native's; see MAX_PADDING_LENGTH.