You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
257 B
12 lines
257 B
2 years ago
|
const getFilled = <T>(
|
||
|
array: T[],
|
||
|
{ isReverse = false }: { isReverse?: boolean } = {},
|
||
|
): T[] =>
|
||
|
array.filter(
|
||
|
isReverse
|
||
|
? (element: T) => element === undefined
|
||
|
: (element: T) => element !== undefined,
|
||
|
);
|
||
|
|
||
|
export default getFilled;
|