From a58bcb93e64cf0b941574b95aeea67d06e81ae6d Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Sun, 4 Dec 2016 08:39:22 -0500 Subject: [PATCH] Update index.js --- src/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 1d64030d1..73f2e7886 100644 --- a/src/index.js +++ b/src/index.js @@ -155,13 +155,17 @@ VirtualMachine.prototype.loadProject = function (json) { this.runtime.setEditingTarget(this.editingTarget); }; +VirtualMachine.prototype.toPrettyJSON = function () { + return JSON.stringify(this.toJSON(), null, 4); +} + VirtualMachine.prototype.toJSON = function () { var obj = new Object(); obj.sprites = this.runtime.targets; obj.meta = new Object(); obj.meta.name = 'WIP'; obj.meta.useragent = navigator.userAgent; - return JSON.stringify(obj, null, 2); + return obj; }; VirtualMachine.prototype.fromJSON = function (json) {