nl_tokens: Format object even with random RPC caviets
pl_tokens: function formatObject ( formatter , value , encode ) { var output = Object . assign ( { } , value ) ; // eslint-disable-line var formatObject = null ; // eslint-disable-line // if the object is a string flag, then retreive the object if ( typeof formatter === 'string' ) { if ( formatter === 'Boolean|EthSyncing' ) { formatObject = Object . assign ( { } , schema . objects . EthSyncing ) ; } else if ( formatter === 'DATA|Transaction' ) { formatObject = Object . assign ( { } , schema . objects . Transaction ) ; } else { formatObject = Object . assign ( { } , schema . <mask> [ formatter ] ) ; } } // check if all required data keys are fulfilled if ( ! arrayContainsArray ( Object . keys ( value ) , formatObject . __required ) ) { // eslint-disable-line throw new Error ( ` ${ JSON . stringify ( value ) } ${ formatObject . __required . join ( ', ' ) } ` ) ; // eslint-disable-line } // assume formatObject is an object, go through keys and format each Object . keys ( formatObject ) . forEach ( ( valueKey ) => { if ( valueKey !== '__required' && typeof value [ valueKey ] !== 'undefined' ) { output [ valueKey ] = format ( formatObject [ valueKey ] , value [ valueKey ] , encode ) ; } } ) ; return output ; }