File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -63,10 +63,20 @@ export function coerce<T>(array: ArrayLike<T>): readonly T[] {
6363 return isArray ( array ) ? array : copy ( array ) ;
6464}
6565
66- export function head < T > ( array : ArrayLike < T > ) : T | null {
66+ export function first < T > ( array : ArrayLike < T > ) : T | null {
6767 return array . length === 0 ? null : array [ 0 ] ;
6868}
6969
70+ /** @deprecated Use {@link first} instead. */
71+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
72+ // @ts -ignore duplicate identifier: This is the exported declaration, the implementation is below.
73+ export function head < T > ( array : ArrayLike < T > ) : T | null ;
74+
75+ /** @internal This implementation is for internal use only, the exported declaration is above */
76+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
77+ // @ts -ignore duplicate identifier: This is the actual implementation, the exported declaration is above.
78+ const head = first ;
79+
7080export function tail < T > ( array : ArrayLike < T > ) : T [ ] {
7181 return nativeSlice . call ( array , 1 ) ;
7282}
You can’t perform that action at this time.
0 commit comments