ut2 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -61,7 +61,7 @@ const debounced = debounce(() => {
61
61
  - compact - 剔除假值元素。
62
62
  - difference - 排除部分值。
63
63
  - formPairs - 将键值对转为对象。
64
- - intersection - 数组交集。
64
+ - intersection - 交集去重。
65
65
  - nth - 获取第 `n` 个元素。
66
66
  - shuffle - 打乱数组。
67
67
  - union - 并集去重。
package/dist/ut2.js CHANGED
@@ -262,7 +262,7 @@
262
262
  var numberIsSafeInteger = Number.isSafeInteger;
263
263
  var objectGetOwnPropertySymbols = Object.getOwnPropertySymbols;
264
264
  var arrayAt = Array.prototype.at;
265
- var VERSION = "1.1.0";
265
+ var VERSION = "1.1.2";
266
266
 
267
267
  function isFunction(value) {
268
268
  if (!isObject(value)) {
@@ -869,7 +869,9 @@
869
869
  var o = Object(object);
870
870
  while (o) {
871
871
  getSymbols(o).forEach(function (item) {
872
- result.push(item);
872
+ if (result.indexOf(item) === -1) {
873
+ result.push(item);
874
+ }
873
875
  });
874
876
  o = Object.getPrototypeOf(o);
875
877
  }
@@ -896,7 +898,8 @@
896
898
  if (!isObject(source) || obj === source) {
897
899
  return obj;
898
900
  }
899
- for (var key in source) {
901
+ var keys = allKeysIn(source);
902
+ keys.forEach(function (key) {
900
903
  var srcValue = source[key];
901
904
  var newValue = typeof customizer === 'function'
902
905
  ? customizer(obj[key], srcValue, key, obj, source)
@@ -921,7 +924,7 @@
921
924
  obj[key] = newValue;
922
925
  }
923
926
  }
924
- }
927
+ });
925
928
  return obj;
926
929
  }
927
930
  function merge(object, source, customizer) {
@@ -1278,7 +1281,7 @@
1278
1281
  }
1279
1282
 
1280
1283
  function conformsTo(object, source) {
1281
- var props = Object.keys(source);
1284
+ var props = allKeys(source);
1282
1285
  var length = props.length;
1283
1286
  if (object == null) {
1284
1287
  return !length;