platform-bible-utils
    Preparing search index...

    Function normalize

    • This function mirrors the normalize function from the JavaScript Standard String object, with one addition: 'none' returns the string unchanged, where native throws a RangeError.

      Note this deliberately does not go through GraphemeString: normalization reads the whole string and never needs it segmented, so routing it through the class would add segmentation cost for no benefit.

      Parameters

      • string: string

        The starting string

      • form: "none" | "NFC" | "NFD" | "NFKC" | "NFKD"

        Form specifying the Unicode Normalization Form, or 'none' to return the string as-is

      Returns string

      A string containing the Unicode Normalization Form of the given string