diff --git a/src/libs/StringUtils.js b/src/libs/StringUtils.js deleted file mode 100644 index 8219f9e8077f..000000000000 --- a/src/libs/StringUtils.js +++ /dev/null @@ -1,12 +0,0 @@ -import _ from 'lodash'; -import CONST from '../CONST'; -/** - * Removes diacritical marks and non-alphabetic and non-latin characters from a string. - * @param {String} str - The input string to be sanitized. - * @returns {String} The sanitized string - */ -function sanitizeString(str) { - return _.chain(str).deburr().toLower().value().replaceAll(CONST.REGEX.NON_ALPHABETIC_AND_NON_LATIN_CHARS, ''); -} - -export default {sanitizeString}; diff --git a/src/libs/StringUtils.ts b/src/libs/StringUtils.ts new file mode 100644 index 000000000000..8ef23bb0751b --- /dev/null +++ b/src/libs/StringUtils.ts @@ -0,0 +1,13 @@ +import _ from 'lodash'; +import CONST from '../CONST'; + +/** + * Removes diacritical marks and non-alphabetic and non-latin characters from a string. + * @param str - The input string to be sanitized. + * @returns The sanitized string + */ +function sanitizeString(str: string): string { + return _.deburr(str).toLowerCase().replaceAll(CONST.REGEX.NON_ALPHABETIC_AND_NON_LATIN_CHARS, ''); +} + +export default {sanitizeString};