function toPrettyJSON(obj) {
        try {
            if (typeof(obj) === 'string') {
                return JSON.stringify(JSON.parse(obj), null, 4);
            } else {
                return JSON.stringify(obj, null, 4);
            }
        } catch (err)  {
            return 'INVALID JSON: ' + err;
        }
    }
/**
     * Returns an JSON string, nicely formatted with 4 space indention
     * @param {string} obj Object or JSON string to format
     * @returns {string} Neatly formatted JSON string
     */
Returns an JSON string, nicely formatted with 4 space indention
@param {string} obj Object or JSON string to format
@returns {string} Neatly formatted JSON string
Returns an JSON string nicely formatted with 4 space indention @param { string } obj Object or JSON string to format @returns { string } Neatly formatted JSON string
function toPrettyJSON(obj) {
        try {
            if (typeof(obj) === 'string') {
                return JSON.stringify(JSON.parse(obj), null, 4);
            } else {
                return JSON.stringify(obj, null, 4);
            }
        } catch (err)  {
            return 'INVALID JSON: ' + err;
        }
    }
function toPrettyJSON ( obj ) { try { if ( typeof ( obj ) === 'string' ) { return JSON . stringify ( JSON . parse ( obj ) , null , 4 ) ; } else { return JSON . stringify ( obj , null , 4 ) ; } } catch ( err ) { return 'INVALID JSON: ' + err ; } }
Returns an JSON string, nicely formatted with 4 space indention
 @param {string} obj Object or JSON string to format
 @returns {string} Neatly formatted JSON string
Returns an JSON string nicely formatted with 4 space indention @param { string } obj Object or JSON string to format @returns { string } Neatly formatted JSON string