Skip to content
module@warp-drive/utilities

Function filterEmpty() ​

ts
function filterEmpty(source: Record<string, Serializable>): Record<string, Serializable>;

Defined in: index.ts:657

filter out keys of an object that have falsy values or point to empty arrays returning a new object with only those keys that have truthy values / non-empty arrays

See Cache Keys for Requests for why builders need stable query params.

Parameters ​

source ​

Record<string, Serializable>

object to filter keys with empty values from

Returns ​

Record<string, Serializable>

A new object with the keys that contained empty values removed

Released under the MIT License.