Skip to content

Commit

Permalink
added default "step" to json
Browse files Browse the repository at this point in the history
  • Loading branch information
vkiryukhin committed Jun 20, 2012
1 parent f3b2c12 commit 31b06d8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vkbeautify.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ vkbeautify.prototype.xml = function(text,step) {
vkbeautify.prototype.json = function(text,step) {

// Attempt to process using the native JSON first
var step = step ? step : this.step;

if ( window.JSON && window.JSON.stringify ) {
if ( typeof text === "string" ) {
return JSON.stringify(JSON.parse(text), null, step);
Expand Down

0 comments on commit 31b06d8

Please sign in to comment.