docs: function cmpVersion(a, b) {
      "use strict";
      var i, cmp, len, re = /(\.0)+[^\.]*$/;
      function versionToString(version) {
          if (isObject(version)) {
              try {
                  return [version.major, version.minor, version.patch].join('.');
              } catch (e) {}
          }
          return version;
      }
      a = versionToString(a);
      b = versionToString(b);
      a = (a + '').replace(re, '').split('.');
      b = (b + '').replace(re, '').split('.');
      len = Math.min(a.length, b.length);
      for (i = 0; i < len; i++) {
          cmp = parseInt(a[i], 10) - parseInt(b[i], 10);
          if (cmp !== 0) {
              return cmp;
          }
      }
      return a.length - b.length;
  }