@solibo/home-api 1.1.18 → 1.1.19

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.
@@ -37,6 +37,17 @@ if (typeof Array.prototype.fill === 'undefined') {
37
37
  Object.defineProperty(TypedArray.prototype, 'fill', {value: Array.prototype.fill});
38
38
  }
39
39
  });
40
+ if (typeof Math.clz32 === 'undefined') {
41
+ Math.clz32 = function (log, LN2) {
42
+ return function (x) {
43
+ var asUint = x >>> 0;
44
+ if (asUint === 0) {
45
+ return 32;
46
+ }
47
+ return 31 - (log(asUint) / LN2 | 0) | 0; // the "| 0" acts like math.floor
48
+ };
49
+ }(Math.log, Math.LN2);
50
+ }
40
51
  if (typeof Math.trunc === 'undefined') {
41
52
  Math.trunc = function (x) {
42
53
  if (isNaN(x)) {
@@ -48,16 +59,11 @@ if (typeof Math.trunc === 'undefined') {
48
59
  return Math.ceil(x);
49
60
  };
50
61
  }
51
- if (typeof Math.clz32 === 'undefined') {
52
- Math.clz32 = function (log, LN2) {
53
- return function (x) {
54
- var asUint = x >>> 0;
55
- if (asUint === 0) {
56
- return 32;
57
- }
58
- return 31 - (log(asUint) / LN2 | 0) | 0; // the "| 0" acts like math.floor
59
- };
60
- }(Math.log, Math.LN2);
62
+ if (typeof String.prototype.startsWith === 'undefined') {
63
+ Object.defineProperty(String.prototype, 'startsWith', {value: function (searchString, position) {
64
+ position = position || 0;
65
+ return this.lastIndexOf(searchString, position) === position;
66
+ }});
61
67
  }
62
68
  if (typeof String.prototype.endsWith === 'undefined') {
63
69
  Object.defineProperty(String.prototype, 'endsWith', {value: function (searchString, position) {
@@ -70,12 +76,6 @@ if (typeof String.prototype.endsWith === 'undefined') {
70
76
  return lastIndex !== -1 && lastIndex === position;
71
77
  }});
72
78
  }
73
- if (typeof String.prototype.startsWith === 'undefined') {
74
- Object.defineProperty(String.prototype, 'startsWith', {value: function (searchString, position) {
75
- position = position || 0;
76
- return this.lastIndexOf(searchString, position) === position;
77
- }});
78
- }
79
79
  //endregion
80
80
  //region block: imports
81
81
  var imul_0 = Math.imul;