migrate mobile ui utils to typescript

This commit is contained in:
MaysWind
2025-01-11 00:53:22 +08:00
parent 8da3d2aa35
commit b2e36a24fd
25 changed files with 88 additions and 65 deletions
+10
View File
@@ -133,6 +133,16 @@ export function isObjectEmpty(obj: object): boolean {
return true;
}
export function getNumberValue(value: unknown, defaultValue: number): number {
if (isString(value)) {
return parseInt(value as string, 10);
} else if (isNumber(value)) {
return value as number;
} else {
return defaultValue;
}
}
export function sortNumbersArray(array: number[]): number[] {
return array.sort(function (num1, num2) {
return num1 - num2;