☕️ Classic, reliable, trusted test framework for Node.js and the browser
utils.js: correcting botched indentation in canonicalize()
Christopher Hillerdf81760211fd
diff --git a/lib/utils.js b/lib/utils.jsindex cb0ddd37..28af618f 100644--- a/lib/utils.js+++ b/lib/utils.js@@ -309,35 +309,36 @@ exports.stringify = function(obj) {/*** Return a new object that has the keys in sorted order.* @param {Object} obj+ * @param {Array} [stack]* @return {Object}* @api private*/exports.canonicalize = function(obj, stack) {- stack = stack || [];-- if (exports.indexOf(stack, obj) !== -1) return '[Circular]';-- var canonicalizedObj;-- if ({}.toString.call(obj) === '[object Array]') {- stack.push(obj);- canonicalizedObj = exports.map(obj, function(item) {- return exports.canonicalize(item, stack);- });- stack.pop();- } else if (typeof obj === 'object' && obj !== null) {- stack.push(obj);- canonicalizedObj = {};- exports.forEach(exports.keys(obj).sort(), function(key) {- canonicalizedObj[key] = exports.canonicalize(obj[key], stack);- });- stack.pop();- } else {- canonicalizedObj = obj;- }-- return canonicalizedObj;+ stack = stack || [];++ if (exports.indexOf(stack, obj) !== -1) return '[Circular]';++ var canonicalizedObj;++ if ({}.toString.call(obj) === '[object Array]') {+ stack.push(obj);+ canonicalizedObj = exports.map(obj, function (item) {+ return exports.canonicalize(item, stack);+ });+ stack.pop();+ } else if (typeof obj === 'object' && obj !== null) {+ stack.push(obj);+ canonicalizedObj = {};+ exports.forEach(exports.keys(obj).sort(), function (key) {+ canonicalizedObj[key] = exports.canonicalize(obj[key], stack);+ });+ stack.pop();+ } else {+ canonicalizedObj = obj;+ }++ return canonicalizedObj;}/**