summaryrefslogtreecommitdiff
path: root/share/www/script/futon.format.js
diff options
context:
space:
mode:
Diffstat (limited to 'share/www/script/futon.format.js')
-rw-r--r--share/www/script/futon.format.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/share/www/script/futon.format.js b/share/www/script/futon.format.js
index b8870a94..028119ed 100644
--- a/share/www/script/futon.format.js
+++ b/share/www/script/futon.format.js
@@ -16,13 +16,11 @@
// JSON pretty printing
formatJSON: function(val, options) {
- options = options || {};
- if (options.indent === undefined) {
- options.indent = 4;
- }
- options.indent = options.indent !== undefined ? options.indent : 4;
- options.linesep = options.linesep !== undefined ? options.linesep : "\n";
- options.quoteKeys = options.quoteKeys !== undefined ? options.quoteKeys : true;
+ options = $.extend({
+ indent: 4,
+ linesep: "\n",
+ quoteKeys: true
+ }, options || {});
var itemsep = options.linesep.length ? "," + options.linesep : ", ";
function escape(string) {