"Fossies" - the Fresh Open Source Software Archive

Member "jitsi-meet-7319/react/features/base/util/strings.web.ts" (6 Jun 2023, 652 Bytes) of package /linux/misc/jitsi-meet-7319.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TypeScript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /**
    2  * Applies NFKC normalization to the given text.
    3  *
    4  * @param {string} text - The text that needs to be normalized.
    5  * @returns {string} - The normalized text.
    6  */
    7 export function normalizeNFKC(text: string) {
    8     return text.normalize('NFKC');
    9 }
   10 
   11 /**
   12  * Replaces accent characters with english alphabet characters.
   13  * NOTE: Here we use the unorm package because the JSC version in React Native for Android crashes.
   14  *
   15  * @param {string} text - The text that needs to be normalized.
   16  * @returns {string} - The normalized text.
   17  */
   18 export function normalizeAccents(text: string) {
   19     return text.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
   20 }