UNPKG

presta

Version:

Hyper minimal framework for the modern web.

11 lines (9 loc) 226 B
type Obj = { [key: string]: any } export function pruneObject(obj: Obj) { return Object.entries(obj) .filter(([key, val]) => !!val) .reduce((o, [key, val]) => { o[key] = val return o }, {} as Obj) }