-
Going mad trying to assert non nulls with typescript as
Array.filter
is not good enough. -
Reading about predicate, but still struggled a lot.
function isNonNull<T>(val: T | null | undefined): val is T {
return val !== null && val !== undefined;
}
const cleanupNullsinArray = cleanupNulls.filter(isNonNull);
- Have success with openapi-client-axios and [openapi-client-axios-typegen]](https://github.com/anttiviljami/openapi-client-axios/blob/master/packages/openapi-client-axios/README.md#generating-type-files-dts) for generating types automatically from any open-api compliant REST api.