4 lines
146 B
TypeScript
4 lines
146 B
TypeScript
export function filterDefined<T>(array: (T | null | undefined)[]) {
|
|
return array.filter((item) => item !== null && item !== undefined) as T[]
|
|
}
|