export function mutateAllValuesToNull ( object ) { const whitelistedKeys = [ "page" , "per_page" ] ; if ( object && typeof object === "object" ) { Object . keys ( object ) . forEach ( ( key ) => { if ( whitelistedKeys . includes ( key ) ) { return ; } if ( ! object ) { return ; } if ( Array . isArray ( object ) ) { object . forEach ( mutateAllValuesToNull ) ; return ; } if ( typeof object [ key ] === "object" ) { mutateAllValuesToNull ( object [ key ] ) ; return ; } if ( object [ key ] ) { object [ key ] = null ; } } ) ; } return object ; }