diff --git a/types/json-object.vue b/types/json-object.vue
index cf8ba10..05b3e97 100644
--- a/types/json-object.vue
+++ b/types/json-object.vue
@@ -3,7 +3,7 @@
{
-
+
...
}
@@ -22,14 +22,14 @@ export default {
},
computed: {
ordered () {
- const ordered = {};
- if (this.sortKeys) {
- Object.keys(this.jsonValue).sort().forEach(key => {
- ordered[key] = this.jsonValue[key];
- });
- } else {
- ordered = this.jsonValue
+ if (!this.sortKeys) {
+ return this.jsonValue;
}
+
+ const ordered = {};
+ Object.keys(this.jsonValue).sort().forEach(key => {
+ ordered[key] = this.jsonValue[key];
+ });
return ordered;
}
},