Skip to content

Commit 3210eb8

Browse files
committed
fix(keys): fix incorrect type parameter T (must extend object)
1 parent df611ac commit 3210eb8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ export function objectFromEntries<TKey extends Key, TValue>(
8686

8787
/** Returns an array of the object's own ennumerable string-keyed property names. */
8888
// @ts-ignore duplicate identifier: This is the exported declaration, the implementation is below.
89-
export function keys<T>(object: T): Array<StringKey<T>>;
89+
export function keys<T extends object>(object: T): Array<StringKey<T>>;
9090

9191
/* @internal This implementation is for internal use only, the exported declaration is above */
9292
// @ts-ignore duplicate identifier: This is the actual implementation, the exported declaration is above.
93-
export const keys: <T>(object: T) => Array<StringKey<T>> = Object.keys;
93+
export const keys: <T extends object>(object: T) => Array<StringKey<T>> = Object.keys;
9494

9595
/** Returns an array of the object's own ennumerable string-keyed property
9696
* values. */

0 commit comments

Comments
 (0)