ut2 1.4.6 → 1.4.8

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;
@@ -381,7 +384,6 @@
381
384
  }
382
385
 
383
386
  var symbolToString = symbolProto ? symbolProto.toString : undefined;
384
-
385
387
  function baseToString(value) {
386
388
  if (typeof value === 'string') {
387
389
  return value;
@@ -473,7 +475,7 @@
473
475
  return value == null || value !== value ? defaultValue : value;
474
476
  }
475
477
 
476
- var VERSION = "1.4.6";
478
+ var VERSION = "1.4.8";
477
479
  var supportedArgumentsType = objectToString.call((function () { return arguments; })()) === argumentsTag;
478
480
  var FUNC_ERROR_TEXT = 'Expected a function';
479
481
  function toSource(func) {
@@ -712,8 +714,11 @@
712
714
  }
713
715
 
714
716
  function isBuffer(value) {
715
- if (typeof Buffer === 'function' && typeof Buffer.isBuffer === 'function') {
716
- return Buffer.isBuffer(value);
717
+ if (typeof Buffer === 'function') {
718
+ var isBuffer_1 = Buffer.isBuffer;
719
+ if (typeof isBuffer_1 === 'function') {
720
+ return isBuffer_1(value);
721
+ }
717
722
  }
718
723
  return false;
719
724
  }
@@ -795,7 +800,7 @@
795
800
  if (!isObjectLike(value) || getTag(value) !== objectTag) {
796
801
  return false;
797
802
  }
798
- var proto = Object.getPrototypeOf(Object(value));
803
+ var proto = objectGetPrototypeOf(Object(value));
799
804
  if (proto === null) {
800
805
  return true;
801
806
  }
@@ -818,7 +823,7 @@
818
823
 
819
824
  function keys(value) {
820
825
  if (!isPrototype(value)) {
821
- return Object.keys(value);
826
+ return objectKeys(value);
822
827
  }
823
828
  var result = [];
824
829
  for (var key in Object(value)) {
@@ -867,11 +872,9 @@
867
872
  if (!isObject(object)) {
868
873
  return [];
869
874
  }
870
- return Object.keys(object).concat(getSymbols(object));
875
+ return objectKeys(object).concat(getSymbols(object));
871
876
  }
872
877
 
873
- var symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
874
-
875
878
  function isNil(value) {
876
879
  return value == null;
877
880
  }
@@ -887,6 +890,7 @@
887
890
  return false;
888
891
  }
889
892
 
893
+ var symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
890
894
  function mapToArray(map) {
891
895
  var result = [];
892
896
  map.forEach(function (value, key) {
@@ -1330,7 +1334,7 @@
1330
1334
  result.push(item);
1331
1335
  }
1332
1336
  });
1333
- o = Object.getPrototypeOf(o);
1337
+ o = objectGetPrototypeOf(o);
1334
1338
  }
1335
1339
  return result;
1336
1340
  }