feat: convert-days-to-hours (time tools)

This commit is contained in:
Chesterkxng
2025-03-24 20:23:28 +00:00
parent 330e24e27d
commit 3c51268397
9 changed files with 183 additions and 3 deletions

View File

@@ -5,7 +5,7 @@ export function capitalizeFirstLetter(string: string | undefined) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
export function isNumber(number: any) {
export function isNumber(number: any): boolean {
return !isNaN(parseFloat(number)) && isFinite(number);
}
@@ -37,3 +37,12 @@ export const replaceSpecialCharacters = (str: string) => {
export function reverseString(input: string): string {
return input.split('').reverse().join('');
}
/**
* Checks if the input string contains only digits.
* @param input - The string to validate.
* @returns True if the input contains only digits, false otherwise.
*/
export function containsOnlyDigits(input: string): boolean {
return /^\d+$/.test(input.trim());
}