ut2 1.4.7 → 1.4.9

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
@@ -11,13 +11,16 @@
11
11
  var objectProto = Object.prototype;
12
12
  var objectToString = objectProto.toString;
13
13
  var objectGetOwnPropertySymbols = Object.getOwnPropertySymbols;
14
+ var objectGetPrototypeOf = Object.getPrototypeOf;
15
+ var objectKeys = Object.keys;
14
16
  var hasOwnProperty = objectProto.hasOwnProperty;
15
17
  var propertyIsEnumerable = objectProto.propertyIsEnumerable;
16
18
  var functionToString = Function.prototype.toString;
17
- var symbolProto = Symbol ? Symbol.prototype : undefined;
18
- var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
19
+ var symbolExisted = typeof Symbol !== 'undefined';
20
+ var symbolProto = symbolExisted ? Symbol.prototype : undefined;
21
+ var symToStringTag = symbolExisted ? Symbol.toStringTag : undefined;
19
22
  var arrayProto = Array.prototype;
20
- var arrSlice = Array.prototype.slice;
23
+ var arrSlice = arrayProto.slice;
21
24
  var arrayAt = arrayProto.at;
22
25
  var numberIsFinite = Number.isFinite;
23
26
  var numberIsInteger = Number.isInteger;
@@ -472,7 +475,7 @@
472
475
  return value == null || value !== value ? defaultValue : value;
473
476
  }
474
477
 
475
- var VERSION = "1.4.7";
478
+ var VERSION = "1.4.9";
476
479
  var supportedArgumentsType = objectToString.call((function () { return arguments; })()) === argumentsTag;
477
480
  var FUNC_ERROR_TEXT = 'Expected a function';
478
481
  function toSource(func) {
@@ -667,10 +670,9 @@
667
670
  return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
668
671
  }
669
672
 
670
- var freeGlobalThis = typeof globalThis === 'object' && globalThis && globalThis.Object === Object && globalThis;
671
673
  var freeGlobal = typeof global === 'object' && global && global.Object === Object && global;
672
674
  var freeSelf = typeof self === 'object' && self && self.Object === Object && self;
673
- var root = freeGlobalThis || freeGlobal || freeSelf || Function('return this')() || {};
675
+ var root = freeGlobal || freeSelf || Function('return this')() || {};
674
676
 
675
677
  var freeExports = typeof exports === 'object' && exports && !exports.nodeType && exports;
676
678
  var freeModule = freeExports && typeof module === 'object' && module && !module.nodeType && module;
@@ -711,8 +713,11 @@
711
713
  }
712
714
 
713
715
  function isBuffer(value) {
714
- if (typeof Buffer === 'function' && typeof Buffer.isBuffer === 'function') {
715
- return Buffer.isBuffer(value);
716
+ if (typeof Buffer === 'function') {
717
+ var isBuffer_1 = Buffer.isBuffer;
718
+ if (typeof isBuffer_1 === 'function') {
719
+ return isBuffer_1(value);
720
+ }
716
721
  }
717
722
  return false;
718
723
  }
@@ -794,7 +799,7 @@
794
799
  if (!isObjectLike(value) || getTag(value) !== objectTag) {
795
800
  return false;
796
801
  }
797
- var proto = Object.getPrototypeOf(Object(value));
802
+ var proto = objectGetPrototypeOf(Object(value));
798
803
  if (proto === null) {
799
804
  return true;
800
805
  }
@@ -817,7 +822,7 @@
817
822
 
818
823
  function keys(value) {
819
824
  if (!isPrototype(value)) {
820
- return Object.keys(value);
825
+ return objectKeys(value);
821
826
  }
822
827
  var result = [];
823
828
  for (var key in Object(value)) {
@@ -866,7 +871,7 @@
866
871
  if (!isObject(object)) {
867
872
  return [];
868
873
  }
869
- return Object.keys(object).concat(getSymbols(object));
874
+ return objectKeys(object).concat(getSymbols(object));
870
875
  }
871
876
 
872
877
  function isNil(value) {
@@ -1328,7 +1333,7 @@
1328
1333
  result.push(item);
1329
1334
  }
1330
1335
  });
1331
- o = Object.getPrototypeOf(o);
1336
+ o = objectGetPrototypeOf(o);
1332
1337
  }
1333
1338
  return result;
1334
1339
  }