foxts
Version:
Opinionated collection of common TypeScript utils by @SukkaW
12 lines (10 loc) • 467 B
TypeScript
/**
* The only use case I have thought of so far would be @typescript-eslint/await-thenable banning
*
* `await Promise.all(Array<Promise | null | undefined>)`
*
* So instead of `.filter(not('nullish'))` which need to iterate through array, we use this when pushing
* things to array in the first place
*/
declare function arrayPushNonNullish<T>(arr: T[], itemOrItems: T | null | undefined | Array<T | null | undefined>): void;
export { arrayPushNonNullish };