ut2 1.19.1 → 1.20.0

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/dist/ut2.js CHANGED
@@ -607,7 +607,7 @@
607
607
  return value == null || value !== value ? defaultValue : value;
608
608
  };
609
609
 
610
- var VERSION = "1.19.1";
610
+ var VERSION = "1.20.0";
611
611
  var isBrowser = typeof window !== stringUndefined && isObjectLike(window) && typeof document !== stringUndefined && isObjectLike(document) && window.document === document;
612
612
  var supportedArgumentsType = getTag((function () { return arguments; })()) === argumentsTag;
613
613
  var FUNC_ERROR_TEXT = 'Expected a function';
@@ -1651,7 +1651,7 @@
1651
1651
  }
1652
1652
 
1653
1653
  function toKey(value) {
1654
- return isSymbol(value) ? value : toString(value);
1654
+ return isSymbol(value) ? value : isNil(value) ? value + '' : toString(value);
1655
1655
  }
1656
1656
  function toPath(value, object) {
1657
1657
  if (isArray(value)) {
@@ -1752,6 +1752,37 @@
1752
1752
  return getKeysIn(object);
1753
1753
  }
1754
1754
 
1755
+ function hasPath(object, key, hasFunc) {
1756
+ var paths = toPath(key, object);
1757
+ var length = paths.length;
1758
+ var index = 0;
1759
+ var result = true;
1760
+ while (!isNil(object) && index < length) {
1761
+ var key_1 = paths[index];
1762
+ result = hasFunc(object, key_1);
1763
+ if (!result) {
1764
+ break;
1765
+ }
1766
+ object = object[key_1];
1767
+ index++;
1768
+ }
1769
+ return !!index && index === length && result;
1770
+ }
1771
+
1772
+ function baseHas(object, key) {
1773
+ return objectProtoHasOwnProperty.call(object, key);
1774
+ }
1775
+ function has(object, key) {
1776
+ return !isNil(object) && hasPath(object, key, baseHas);
1777
+ }
1778
+
1779
+ function baseHasIn(object, key) {
1780
+ return key in Object(object);
1781
+ }
1782
+ function hasIn(object, key) {
1783
+ return !isNil(object) && hasPath(object, key, baseHasIn);
1784
+ }
1785
+
1755
1786
  function baseMerge(object, source, getKeys, customizer, stack) {
1756
1787
  if (stack === void 0) { stack = new WeakMap(); }
1757
1788
  var obj = Object(object);
@@ -2237,6 +2268,8 @@
2237
2268
  exports.gt = gt;
2238
2269
  exports.gte = gte;
2239
2270
  exports.guard = guard;
2271
+ exports.has = has;
2272
+ exports.hasIn = hasIn;
2240
2273
  exports.identity = identity;
2241
2274
  exports.inRange = inRange;
2242
2275
  exports.intersection = intersection;