refactor(client): add proper types to never[] (#9340)

This commit is contained in:
Kagami Sascha Rosylight 2022-12-18 13:13:05 +09:00 committed by GitHub
parent af9034355c
commit bb3d274db6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 78 additions and 28 deletions

View file

@ -123,7 +123,7 @@ export function lessThan(xs: number[], ys: number[]): boolean {
* Returns the longest prefix of elements that satisfy the predicate
*/
export function takeWhile<T>(f: Predicate<T>, xs: T[]): T[] {
const ys = [];
const ys: T[] = [];
for (const x of xs) {
if (f(x)) {
ys.push(x);