``` if ( typeof item !== 'object' || item === null || 'id' in item === false || 'type' in item === false ) { return item } ``` was failing