Skip to content

utils/compact ​

Functions ​

compactSparseArrays() ​

compactSparseArrays(obj): void

Remove undefined values from arrays in a mixed object array tree. Mutates the object.

Parameters ​

obj ​

any

The object or array to compact sparse arrays in.

Returns ​

void


removeEmptyObjects() ​

removeEmptyObjects(obj): void

Remove empty objects from a mixed object array tree. Mutates the object.

Parameters ​

obj ​

any

The object or array to remove empty objects from.

Returns ​

void


removeEmptyObjectsAndCompactSparseArrays() ​

removeEmptyObjectsAndCompactSparseArrays(obj): void

Remove empty objects and undefined values from arrays in a mixed object array tree. Mutates the object.

Parameters ​

obj ​

any

The object or array to remove empty objects from and compact sparse arrays in.

Returns ​

void