fix: misc

This commit is contained in:
Ibrahima G. Coulibaly
2024-07-09 21:58:08 +01:00
parent f3e5c0dec7
commit e4c726c7b5
6 changed files with 173 additions and 113 deletions

View File

@@ -6,3 +6,13 @@ export function capitalizeFirstLetter(string: string | undefined) {
export function isNumber(number: any) {
return !isNaN(parseFloat(number)) && isFinite(number);
}
export const replaceSpecialCharacters = (str: string) => {
return str
.replace(/\\n/g, '\n')
.replace(/\\t/g, '\t')
.replace(/\\r/g, '\r')
.replace(/\\b/g, '\b')
.replace(/\\f/g, '\f')
.replace(/\\v/g, '\v');
};