param fallback param val export function withDefault < T > ( fallback , val ) { if ( val !== undefined && val !== null ) return val ; return fallback ; } param f param xs export function filterMap < T , Y > ( xs , f ) { return xs . map ( f ) . filter ( notNull ) ; } param val export function notNull < T > ( val ) { return val !== null ; } param fn export function not < T , TS extends Array < T > > ( fn ) { return ( ... params ) => ! fn ( ... params ) ; } param dict param fn export function filterKeys < T > ( dict , fn ) { return Object . keys ( dict ) . filter ( key => fn ( key , dict [ key ] ) ) . reduce ( ( acc , key ) => ( { ... acc , [ key ] : dict [ key ] } ) , { } ) ; } param dict param fn export function mapEntries < T > ( dict , fn ) { return Object . keys ( dict ) . reduce ( ( acc , key ) => ( { ... acc , [ key ] : fn ( dict [ key ] , key ) } ) , { } ) ; }