import _ from 'lodash';
import React from 'react';

export default function canBeAsserted(vdom) {
    return _.all([].concat(vdom), node =>
        React.isValidElement(node) ||
        (node
        && typeof node === 'object'
        && typeof node.type === 'string'
        && (!node.props || typeof node.props === 'object'))
    );
}
@@ -99,81 +99,42 @@
     
-return _.all(%5B%5D.concat(vdom), node =%3E%0A        React.isValidElemen
+function isCompatibleObjec
 t(node) 
 %7C%7C%0A 
@@ -129,18 +129,17 @@
 t(node) 
-%7C%7C
+%7B
 %0A       
@@ -143,14 +143,24 @@
     
-(
+return 
 node%0A
+    
     
@@ -191,32 +191,36 @@
 object'%0A        
+ 
+   
 && typeof node.t
@@ -244,16 +244,20 @@
         
+   
+ 
 && (!nod
@@ -302,14 +302,122 @@
 ct')
-)%0A    
+;%0A    %7D%0A%0A    return _.all(%5B%5D.concat(vdom), node =%3E%0A        React.isValidElement(node) %7C%7C isCompatibleObject(node)
 );%0A%7D
+%0A

Refactor logic to a separate function