Skip to content

Commit 0004922

Browse files
committed
fix typings
1 parent ee17434 commit 0004922

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/array/length.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
interface Length {
2-
(list: ArrayLike<any>): number | void;
2+
<T>(list: T): T extends ArrayLike<any> ? number : void;
33
}
44

55
/**

src/typings/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export type Ord = number | string | boolean;
22

33
export type ArrBase<T, R> = (value: T, index: number, arr: ArrayLike<T>) => R;
44
export type ObjBase<K extends Prop, V, R> = (value: V, key: K & string, obj: Record<K, V>) => R;
5-
export type ObjBaseBy<O extends Record<any, any>, R> = (value: O[keyof O], key: keyof O, obj: O) => R;
5+
export type ObjBaseBy<O extends Record<any, any>, R> = (value: O[keyof O], key: keyof O & string, obj: O) => R;
66

77
export type CompareFunc<T, R extends Ord> = (a: T, b: T) => R;
88
export type OrdFunc<T, R extends Ord> = (item: T) => R;

0 commit comments

Comments
 (0)