mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-04 05:19:12 -04:00
Fix type
This commit is contained in:
parent
22cdc82e3f
commit
df343d11f5
1 changed files with 1 additions and 1 deletions
|
@ -20,7 +20,7 @@ function sortObjectKeys<T>(obj: T, sortMethod: string): T {
|
|||
}, {} as Record<string, unknown>) as T;
|
||||
}
|
||||
|
||||
function sortObjectValues(obj: any, sortMethod: string, keyName: string): any {
|
||||
function sortObjectValues<T>(obj: T, sortMethod: string, keyName: string): T {
|
||||
if (Array.isArray(obj)) {
|
||||
return obj.sort((a, b) => {
|
||||
const valueA = a[keyName];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue