Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tighten array's higer-order method declarations #7

Closed
yskkin opened this issue Nov 25, 2021 · 1 comment
Closed

Tighten array's higer-order method declarations #7

yskkin opened this issue Nov 25, 2021 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@yskkin
Copy link

yskkin commented Nov 25, 2021

[0, 1, 2, null, undefined].filter(x => x) unintendedly (for me) evaluates to [1, 2].

What do you think about changing declaration of Array.prototype.filter (or any higher-order function which takes predicate) to

    filter(predicate: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[];

from

    filter(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[];

I manually changing lib-es5 from better-typescript-lib and that works good for my project.

@uhyo uhyo added this to the 2.1.0 milestone Nov 26, 2021
@uhyo uhyo added the enhancement New feature or request label Nov 26, 2021
@uhyo uhyo closed this as completed in 1e311d0 Apr 29, 2022
@uhyo
Copy link
Owner

uhyo commented Apr 29, 2022

Thank you, fixed in 2.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants