docs: function canonicalize(obj, stack) {
     stack = stack || [];
  
     if (utils.indexOf(stack, obj) !== -1) return obj;
  
     var canonicalizedObj;
  
     if ('[object Array]' == {}.toString.call(obj)) {
       stack.push(obj);
       canonicalizedObj = utils.map(obj, function(item) {
         return canonicalize(item, stack);
       });
       stack.pop();
     } else if (typeof obj === 'object' && obj !== null) {
       stack.push(obj);
       canonicalizedObj = {};
       utils.forEach(utils.keys(obj).sort(), function(key) {
         canonicalizedObj[key] = canonicalize(obj[key], stack);
       });
       stack.pop();
     } else {
       canonicalizedObj = obj;
     }
  
     return canonicalizedObj;
   }