Skip to content

Commit acc8b60

Browse files
committed
fix(values): correct type signature of values function
1 parent f24c9e6 commit acc8b60

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

index.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,16 @@ export function keys<T extends Key>(dictionary: Readonly<Record<T, unknown>>): s
2222
export const keys: <T extends Key>(dictionary: Readonly<Record<T, unknown>>) => string[] =
2323
Object.keys;
2424

25-
export const values: <T>(dictionary: Readonly<T>) => Array<T[keyof T]> = Object.values;
25+
// @ts-ignore duplicate identifier: This is the exported declaration, the implementation is below.
26+
export function values<TKey extends Key, TValue>(
27+
dictionary: Readonly<Record<TKey, TValue>>
28+
): TValue[];
2629

27-
// @ts-ignore duplicate identifier: These overrides constitute the exported declaration, the implementation is below.
28-
export function entries<T, K extends Key>(dictionary: ReadonlyDictionary<T, K>): Array<[K, T]>;
29-
// @ts-ignore duplicate identifier: These overrides constitute the exported declaration, the implementation is below.
30-
export function entries<T>(dictionary: Readonly<T>): Array<[keyof T, T[keyof T]]>;
30+
/* @internal This implementation is for internal use only, the exported declaration is above. */
31+
// @ts-ignore duplicate identifier: This is the actual implementation, the exported declaration is above.
32+
export const values: <TKey extends Key, TValue>(
33+
dictionary: Readonly<Record<TKey, TValue>>
34+
) => TValue[] = Object.values;
3135

3236
/* @internal This implementation is for internal use only, the exported declaration is above */
3337
// @ts-ignore duplicate identifier: This is the actual implementation, the exported declaration is above.

0 commit comments

Comments
 (0)