diff --git a/src/client/components/types/object.type-renderer.jsx b/src/client/components/types/object.type-renderer.jsx index 0c15878..9c78fae 100644 --- a/src/client/components/types/object.type-renderer.jsx +++ b/src/client/components/types/object.type-renderer.jsx @@ -11,18 +11,24 @@ const decorate = compose( const ObjectRenderer = ({ value, -}) => ( -
- {'{'} -
-      
-        {'  '}
-        {(value ? JSON.stringify(value, null, 2).slice(1).slice(0, -1) : '').trim('\n')}
-      
-    
- {'}'} -
-); +}) => { + const json = ('object' === typeof value && null !== value) + ? JSON.stringify(value, null, 2) + : '{}'; + const brackets = '{' === json.slice(0, 1) ? '{}' : '[]'; + return ( +
+ {brackets.slice(0, 1)} +
+        
+          {'  '}
+          {(value ? json.slice(1).slice(0, -1) : '').trim('\n')}
+        
+      
+ {brackets.slice(1)} +
+ ); +}; ObjectRenderer.propTypes = { ...propertyPropTypes,