/**
 * @fileOverview The util method based on the lodash.
 * @author dxq613@gmail.com
 * @see https://github.com/lodash/lodash
 */

function _mix(dist, obj) {
  for (const k in obj) {
    if (obj.hasOwnProperty(k) && k !== 'constructor' && obj[k] !== undefined) {
      dist[k] = obj[k];
    }
  }
}

const util = {
  each: require('lodash/each'),
  isNull: require('lodash/isNull'),
  isObject: require('lodash/isObject'),
  isNumber: require('lodash/isNumber'),
  isString: require('lodash/isString'),
  lowerFirst: require('lodash/lowerFirst'),
  upperFirst: require('lodash/upperFirst'),
  isNil: require('lodash/isNil'),
  isArray: require('lodash/isArray'),
  isDate: require('lodash/isDate'),
  fixedBase(v, base) {
    const str = base.toString();
    const index = str.indexOf('.');
    if (index === -1) {
      return Math.round(v);
    }
    let length = str.substr(index + 1).length;
    if (length > 20) {
      length = 20;
    }
    return parseFloat(v.toFixed(length));
  },
  mix(dist, obj1, obj2, obj3) {
    if (obj1) {
      _mix(dist, obj1);
    }

    if (obj2) {
      _mix(dist, obj2);
    }

    if (obj3) {
      _mix(dist, obj3);
    }
    return dist;
  }
};

module.exports = util;

@@ -294,16 +294,66 @@
 %0A  %7D%0A%7D%0A%0A
+const PRECISION = 0.00001; // %E5%B8%B8%E9%87%8F%EF%BC%8C%E6%8D%AE%E7%9A%84%E7%B2%BE%E5%BA%A6%EF%BC%8C%E5%B0%8F%E4%BA%8E%E8%BF%99%E4%B8%AA%E7%B2%BE%E5%BA%A6%E8%AE%A4%E4%B8%BA%E6%98%AF0%0A%0A
 const ut
@@ -1224,16 +1224,79 @@
 n dist;%0A
+  %7D,%0A  equal(a, b) %7B%0A    return Math.abs((a - b)) %3C PRECISION;%0A
   %7D%0A%7D;%0A%0A

添加 Util.equal(a, b) 方法。