Additional @internal markers (#1525)

This commit is contained in:
Jaco
2022-06-11 10:48:51 +03:00
committed by GitHub
parent 768cd68146
commit f2064f059f
3 changed files with 9 additions and 3 deletions
+2 -3
View File
@@ -19,9 +19,8 @@ import { isUndefined } from '../is/undefined';
* arrayFilter([0, void 0, true, null, false, ''], false); // [0, true, false, '']
* ```
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function arrayFilter <T = any> (array: T[], allowNulls = true): T[] {
return array.filter((v) =>
export function arrayFilter <T = unknown> (array: (T | null | undefined)[], allowNulls = true): T[] {
return array.filter((v): v is T =>
!isUndefined(v) &&
(allowNulls || !isNull(v))
);