import { RecursivePartial } from "@chainsafe/lodestar-utils" ; /**
 * Removes (mutates) all properties with a value === undefined, recursively
 */ export function removeUndefinedRecursive < T extends { [ key ] : any ; } > ( obj ) { for ( const key of Object . keys ( obj ) ) { const value = obj [ key ] ; if ( value && typeof value === "object" ) removeUndefinedRecursive ( value ) ; else if ( value === undefined ) delete obj [ key ] ; } return obj ; }