mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-09-02 08:37:47 +00:00
ref: Convert some files to TS (#11929)
This commit is contained in:
23
react/features/base/util/strings.native.ts
Normal file
23
react/features/base/util/strings.native.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import * as unorm from 'unorm';
|
||||
|
||||
/**
|
||||
* Applies NFKC normalization to the given text.
|
||||
* NOTE: Here we use the unorm package because the JSC version in React Native for Android crashes.
|
||||
*
|
||||
* @param {string} text - The text that needs to be normalized.
|
||||
* @returns {string} - The normalized text.
|
||||
*/
|
||||
export function normalizeNFKC(text: string) {
|
||||
return unorm.nfkc(text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces accent characters with english alphabet characters.
|
||||
* NOTE: Here we use the unorm package because the JSC version in React Native for Android crashes.
|
||||
*
|
||||
* @param {string} text - The text that needs to be normalized.
|
||||
* @returns {string} - The normalized text.
|
||||
*/
|
||||
export function normalizeAccents(text: string) {
|
||||
return unorm.nfd(text).replace(/[\u0300-\u036f]/g, '');
|
||||
}
|
||||
Reference in New Issue
Block a user