pubo-utils 1.0.67 → 1.0.69

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.
Files changed (52) hide show
  1. package/dist/pubo-utils.js +1 -1
  2. package/es/array/index.d.ts +1 -0
  3. package/es/array/index.js +25 -0
  4. package/es/base64/index.js +16 -21
  5. package/es/color/utils.d.ts +10 -1
  6. package/es/color/utils.js +2 -15
  7. package/es/debounce/index.js +13 -25
  8. package/es/emitter/index.js +17 -42
  9. package/es/factory/index.d.ts +5 -5
  10. package/es/factory/index.js +2 -6
  11. package/es/index.d.ts +2 -0
  12. package/es/index.js +3 -1
  13. package/es/level/index.js +1 -9
  14. package/es/loop/index.d.ts +1 -1
  15. package/es/loop/index.js +67 -118
  16. package/es/math/geometry.js +11 -23
  17. package/es/promise/index.js +16 -25
  18. package/es/queue/index.js +70 -129
  19. package/es/random/index.js +0 -5
  20. package/es/regexp-list/index.d.ts +7 -0
  21. package/es/regexp-list/index.js +20 -0
  22. package/es/sleep/index.js +62 -96
  23. package/es/stack/index.js +1 -16
  24. package/es/throttle/index.js +12 -19
  25. package/es/trigger/index.js +1 -10
  26. package/es/watch-dog/index.js +3 -11
  27. package/lib/array/index.d.ts +1 -0
  28. package/lib/array/index.js +32 -0
  29. package/lib/base64/index.js +16 -24
  30. package/lib/color/utils.d.ts +10 -1
  31. package/lib/color/utils.js +9 -22
  32. package/lib/debounce/index.js +16 -28
  33. package/lib/emitter/index.js +18 -44
  34. package/lib/factory/index.d.ts +5 -5
  35. package/lib/factory/index.js +5 -9
  36. package/lib/index.d.ts +2 -0
  37. package/lib/index.js +26 -44
  38. package/lib/level/index.js +1 -10
  39. package/lib/loop/index.d.ts +1 -1
  40. package/lib/loop/index.js +73 -125
  41. package/lib/math/geometry.js +21 -36
  42. package/lib/promise/index.js +19 -27
  43. package/lib/queue/index.js +70 -130
  44. package/lib/random/index.js +3 -8
  45. package/lib/regexp-list/index.d.ts +7 -0
  46. package/lib/regexp-list/index.js +26 -0
  47. package/lib/sleep/index.js +66 -99
  48. package/lib/stack/index.js +1 -17
  49. package/lib/throttle/index.js +12 -21
  50. package/lib/trigger/index.js +1 -11
  51. package/lib/watch-dog/index.js +3 -12
  52. package/package.json +2 -2
@@ -2,14 +2,11 @@ var __read = this && this.__read || function (o, n) {
2
2
  var m = typeof Symbol === "function" && o[Symbol.iterator];
3
3
  if (!m) return o;
4
4
  var i = m.call(o),
5
- r,
6
- ar = [],
7
- e;
8
-
5
+ r,
6
+ ar = [],
7
+ e;
9
8
  try {
10
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
11
- ar.push(r.value);
12
- }
9
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
13
10
  } catch (error) {
14
11
  e = {
15
12
  error: error
@@ -21,38 +18,34 @@ var __read = this && this.__read || function (o, n) {
21
18
  if (e) throw e.error;
22
19
  }
23
20
  }
24
-
25
21
  return ar;
26
22
  };
27
-
28
- var __spread = this && this.__spread || function () {
29
- for (var ar = [], i = 0; i < arguments.length; i++) {
30
- ar = ar.concat(__read(arguments[i]));
23
+ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
24
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
25
+ if (ar || !(i in from)) {
26
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
27
+ ar[i] = from[i];
28
+ }
31
29
  }
32
-
33
- return ar;
30
+ return to.concat(ar || Array.prototype.slice.call(from));
34
31
  };
35
-
36
32
  export function throttle(cb, time) {
37
33
  var t;
38
34
  var onOff = true;
39
35
  return function () {
40
36
  var args = [];
41
-
42
37
  for (var _i = 0; _i < arguments.length; _i++) {
43
38
  args[_i] = arguments[_i];
44
39
  }
45
-
46
40
  if (!t) {
47
41
  t = setTimeout(function () {
48
42
  onOff = true;
49
43
  t = null;
50
44
  }, time);
51
45
  }
52
-
53
46
  if (onOff) {
54
47
  onOff = false;
55
- cb.apply(void 0, __spread(args));
48
+ cb.apply(void 0, __spreadArray([], __read(args), false));
56
49
  }
57
50
  };
58
51
  }
@@ -1,11 +1,8 @@
1
- var ContinuousTrigger =
2
- /** @class */
3
- function () {
1
+ var ContinuousTrigger = /** @class */function () {
4
2
  function ContinuousTrigger(props) {
5
3
  this._count = 0;
6
4
  this.props = props;
7
5
  }
8
-
9
6
  Object.defineProperty(ContinuousTrigger.prototype, "count", {
10
7
  get: function get() {
11
8
  return this._count;
@@ -13,26 +10,20 @@ function () {
13
10
  enumerable: false,
14
11
  configurable: true
15
12
  });
16
-
17
13
  ContinuousTrigger.prototype.increment = function () {
18
14
  var _this = this;
19
-
20
15
  clearTimeout(this.timeout);
21
16
  this.timeout = setTimeout(function () {
22
17
  return _this.clear();
23
18
  }, this.props.resetTime);
24
19
  this._count = this._count + 1;
25
-
26
20
  if (this._count > this.props.count) {
27
21
  this.props.cb();
28
22
  }
29
23
  };
30
-
31
24
  ContinuousTrigger.prototype.clear = function () {
32
25
  this._count = 0;
33
26
  };
34
-
35
27
  return ContinuousTrigger;
36
28
  }();
37
-
38
29
  export { ContinuousTrigger };
@@ -1,36 +1,28 @@
1
- var WatchDog =
2
- /** @class */
3
- function () {
1
+ var WatchDog = /** @class */function () {
4
2
  function WatchDog(_a) {
5
3
  var _b = _a.limit,
6
- limit = _b === void 0 ? 10 : _b,
7
- onTimeout = _a.onTimeout;
4
+ limit = _b === void 0 ? 10 : _b,
5
+ onTimeout = _a.onTimeout;
8
6
  this.limit = 10;
9
7
  this.timeout = null;
10
8
  this.limit = limit;
11
9
  this.onTimeout = onTimeout;
12
10
  }
13
-
14
11
  WatchDog.prototype.feed = function () {
15
12
  clearTimeout(this.timeout);
16
13
  this.init();
17
14
  };
18
-
19
15
  WatchDog.prototype.init = function () {
20
16
  var _this = this;
21
-
22
17
  this.timeout = setTimeout(function () {
23
18
  return _this.onTimeout();
24
19
  }, this.limit * 1000);
25
20
  };
26
-
27
21
  WatchDog.prototype.stop = function () {
28
22
  if (this.timeout) {
29
23
  clearTimeout(this.timeout);
30
24
  }
31
25
  };
32
-
33
26
  return WatchDog;
34
27
  }();
35
-
36
28
  export { WatchDog };
@@ -0,0 +1 @@
1
+ export declare const concatArray: (list: any[], Type?: any) => any;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.concatArray = void 0;
7
+ var concatArray = function concatArray(list, Type) {
8
+ if (Type === void 0) {
9
+ Type = Array;
10
+ }
11
+ var size = list.map(function (item) {
12
+ return item.length;
13
+ }).reduce(function (v, n) {
14
+ return v + n;
15
+ }, 0);
16
+ var res = new Type(size);
17
+ var j = 0;
18
+ var k = 0;
19
+ var i = 0;
20
+ while (i < size) {
21
+ if (j < list[k].length) {
22
+ res[i] = list[k][j];
23
+ j += 1;
24
+ i += 1;
25
+ } else {
26
+ k += 1;
27
+ j = 0;
28
+ }
29
+ }
30
+ return res;
31
+ };
32
+ exports.concatArray = concatArray;
@@ -4,15 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.toUnit8Array = exports.EncoderMap = void 0;
7
-
8
7
  exports.EncoderMap = function () {
9
8
  var S = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
10
9
  var e = {};
11
-
12
10
  for (var i = 0; i < 64; i++) {
13
11
  e[S.charAt(i)] = i;
14
12
  }
15
-
16
13
  return e;
17
14
  }();
18
15
  /**
@@ -21,36 +18,31 @@ exports.EncoderMap = function () {
21
18
  * @param output Uint8Array
22
19
  * base64 6位的二进制, Uint8Array 8位的二进制,整体原理就是将 base64 的每个字符转成2进制然后拼接,再按每个八位为一个单位地取出
23
20
  */
24
-
25
-
26
21
  function toUnit8Array(input) {
27
- var output = new Uint8Array(input.length * 6 / 8); // 当前二进制字符长度
28
-
29
- var l = 0; // 二进制字符缓存值(格式为10进制)
30
-
31
- var b = 0; // Uint8Array 的指针
32
-
22
+ var output = new Uint8Array(input.length * 6 / 8);
23
+ // 当前二进制字符长度
24
+ var l = 0;
25
+ // 二进制字符缓存值(格式为10进制)
26
+ var b = 0;
27
+ // Uint8Array 的指针
33
28
  var j = 0;
34
-
35
29
  for (var x = 0; x < input.length && j < output.length; x += 1) {
36
- b = (b << 6) + exports.EncoderMap[input.charAt(x)]; // 为什么是6? base64 为64个字符,也就是 2^6,用二进制表示就是6位
37
-
38
- l += 6; // 为什么是8? Uint8Array 是八位的二进制
39
-
30
+ b = (b << 6) + exports.EncoderMap[input.charAt(x)];
31
+ // 为什么是6? base64 为64个字符,也就是 2^6,用二进制表示就是6位
32
+ l += 6;
33
+ // 为什么是8? Uint8Array 是八位的二进制
40
34
  if (l >= 8) {
41
35
  // 取了前八位后剩余长度
42
- l -= 8; // 前八位的值
43
-
36
+ l -= 8;
37
+ // 前八位的值
44
38
  var c = b >>> l;
45
- output[j++] = c & 0xff; // 再将右移的值左移回来,除了前八位不变,后面的皆为0
46
-
47
- c = c << l; // 通过减法得到第八位之后的值
48
-
39
+ output[j++] = c & 0xff;
40
+ // 再将右移的值左移回来,除了前八位不变,后面的皆为0
41
+ c = c << l;
42
+ // 通过减法得到第八位之后的值
49
43
  b = b - c;
50
44
  }
51
45
  }
52
-
53
46
  return output;
54
47
  }
55
-
56
48
  exports.toUnit8Array = toUnit8Array;
@@ -1,5 +1,14 @@
1
1
  export declare const hex2rgb: (n: number | string) => [number, number, number];
2
- export declare const rgb2hex: (color: [number, number, number] | [number, number, number, number]) => string;
2
+ export declare const rgb2hex: (color: [
3
+ number,
4
+ number,
5
+ number
6
+ ] | [
7
+ number,
8
+ number,
9
+ number,
10
+ number
11
+ ]) => string;
3
12
  export declare class ColorUtils {
4
13
  int: number;
5
14
  constructor(n: number | string | [number, number, number]);
@@ -4,78 +4,65 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.ColorUtils = exports.rgb2hex = exports.hex2rgb = void 0;
7
-
8
7
  var str2int = function str2int(str) {
9
8
  return parseInt(str.replace('#', ''), 16);
10
9
  };
11
-
12
- exports.hex2rgb = function (n) {
10
+ var hex2rgb = function hex2rgb(n) {
13
11
  var v;
14
-
15
12
  if (typeof n === 'string') {
16
13
  v = str2int(n);
17
14
  } else {
18
15
  v = n;
19
16
  }
20
-
21
17
  var str = v.toString(2).padStart(24, '0');
22
18
  var r = parseInt(str.slice(0, 8), 2);
23
19
  var g = parseInt(str.slice(8, 16), 2);
24
20
  var b = parseInt(str.slice(16, 24), 2);
25
21
  return [r, g, b];
26
22
  };
27
-
28
- exports.rgb2hex = function (color) {
23
+ exports.hex2rgb = hex2rgb;
24
+ var rgb2hex = function rgb2hex(color) {
29
25
  return '#' + [0, 1, 2].map(function (i) {
30
26
  return color[i].toString(16);
31
27
  }).join('');
32
28
  };
33
-
34
- var ColorUtils =
35
- /** @class */
36
- function () {
29
+ exports.rgb2hex = rgb2hex;
30
+ var ColorUtils = /** @class */function () {
37
31
  function ColorUtils(n) {
38
32
  if (typeof n === 'number') {
39
33
  this["int"] = n;
40
34
  } else if (typeof n === 'string') {
41
35
  this["int"] = str2int(n);
42
36
  } else if (Array.isArray(n)) {
43
- this["int"] = str2int(exports.rgb2hex(n));
37
+ this["int"] = str2int((0, exports.rgb2hex)(n));
44
38
  }
45
39
  }
46
-
47
40
  ColorUtils.prototype.getRgbArray = function () {
48
- return exports.hex2rgb(this["int"]);
41
+ return (0, exports.hex2rgb)(this["int"]);
49
42
  };
50
-
51
43
  Object.defineProperty(ColorUtils.prototype, "rgb", {
52
44
  get: function get() {
53
- return "rba(" + this.getRgbArray().join(', ') + ")";
45
+ return "rba(".concat(this.getRgbArray().join(', '), ")");
54
46
  },
55
47
  enumerable: false,
56
48
  configurable: true
57
49
  });
58
50
  Object.defineProperty(ColorUtils.prototype, "hex", {
59
51
  get: function get() {
60
- return exports.rgb2hex(this.getRgbArray());
52
+ return (0, exports.rgb2hex)(this.getRgbArray());
61
53
  },
62
54
  enumerable: false,
63
55
  configurable: true
64
56
  });
65
-
66
57
  ColorUtils.prototype.toString = function (type) {
67
58
  if (type === void 0) {
68
59
  type = 'hex';
69
60
  }
70
-
71
61
  if (type === 'rgb') {
72
62
  return this.rgb;
73
63
  }
74
-
75
64
  return this.hex;
76
65
  };
77
-
78
66
  return ColorUtils;
79
67
  }();
80
-
81
68
  exports.ColorUtils = ColorUtils;
@@ -4,14 +4,11 @@ var __read = this && this.__read || function (o, n) {
4
4
  var m = typeof Symbol === "function" && o[Symbol.iterator];
5
5
  if (!m) return o;
6
6
  var i = m.call(o),
7
- r,
8
- ar = [],
9
- e;
10
-
7
+ r,
8
+ ar = [],
9
+ e;
11
10
  try {
12
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
13
- ar.push(r.value);
14
- }
11
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
15
12
  } catch (error) {
16
13
  e = {
17
14
  error: error
@@ -23,47 +20,40 @@ var __read = this && this.__read || function (o, n) {
23
20
  if (e) throw e.error;
24
21
  }
25
22
  }
26
-
27
23
  return ar;
28
24
  };
29
-
30
- var __spread = this && this.__spread || function () {
31
- for (var ar = [], i = 0; i < arguments.length; i++) {
32
- ar = ar.concat(__read(arguments[i]));
25
+ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
26
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
27
+ if (ar || !(i in from)) {
28
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
29
+ ar[i] = from[i];
30
+ }
33
31
  }
34
-
35
- return ar;
32
+ return to.concat(ar || Array.prototype.slice.call(from));
36
33
  };
37
-
38
34
  Object.defineProperty(exports, "__esModule", {
39
35
  value: true
40
36
  });
41
37
  exports.debounce = void 0;
42
-
43
- exports.debounce = function (cb, time, first) {
38
+ var debounce = function debounce(cb, time, first) {
44
39
  if (first === void 0) {
45
40
  first = false;
46
41
  }
47
-
48
42
  if (first) {
49
43
  var shouldRun_1 = true;
50
44
  var t_1;
51
45
  return function () {
52
46
  var args = [];
53
-
54
47
  for (var _i = 0; _i < arguments.length; _i++) {
55
48
  args[_i] = arguments[_i];
56
49
  }
57
-
58
50
  if (shouldRun_1) {
59
- cb.apply(void 0, __spread(args));
51
+ cb.apply(void 0, __spreadArray([], __read(args), false));
60
52
  shouldRun_1 = false;
61
53
  }
62
-
63
54
  if (t_1) {
64
55
  clearTimeout(t_1);
65
56
  }
66
-
67
57
  t_1 = setTimeout(function () {
68
58
  return shouldRun_1 = true;
69
59
  }, time);
@@ -72,18 +62,16 @@ exports.debounce = function (cb, time, first) {
72
62
  var t_2;
73
63
  return function () {
74
64
  var args = [];
75
-
76
65
  for (var _i = 0; _i < arguments.length; _i++) {
77
66
  args[_i] = arguments[_i];
78
67
  }
79
-
80
68
  if (t_2) {
81
69
  clearTimeout(t_2);
82
70
  }
83
-
84
71
  t_2 = setTimeout(function () {
85
- return cb.apply(void 0, __spread(args));
72
+ return cb.apply(void 0, __spreadArray([], __read(args), false));
86
73
  }, time);
87
74
  };
88
75
  }
89
- };
76
+ };
77
+ exports.debounce = debounce;
@@ -2,8 +2,8 @@
2
2
 
3
3
  var __values = this && this.__values || function (o) {
4
4
  var s = typeof Symbol === "function" && Symbol.iterator,
5
- m = s && o[s],
6
- i = 0;
5
+ m = s && o[s],
6
+ i = 0;
7
7
  if (m) return m.call(o);
8
8
  if (o && typeof o.length === "number") return {
9
9
  next: function next() {
@@ -16,19 +16,15 @@ var __values = this && this.__values || function (o) {
16
16
  };
17
17
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
18
18
  };
19
-
20
19
  var __read = this && this.__read || function (o, n) {
21
20
  var m = typeof Symbol === "function" && o[Symbol.iterator];
22
21
  if (!m) return o;
23
22
  var i = m.call(o),
24
- r,
25
- ar = [],
26
- e;
27
-
23
+ r,
24
+ ar = [],
25
+ e;
28
26
  try {
29
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
30
- ar.push(r.value);
31
- }
27
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
32
28
  } catch (error) {
33
29
  e = {
34
30
  error: error
@@ -40,71 +36,57 @@ var __read = this && this.__read || function (o, n) {
40
36
  if (e) throw e.error;
41
37
  }
42
38
  }
43
-
44
39
  return ar;
45
40
  };
46
-
47
- var __spread = this && this.__spread || function () {
48
- for (var ar = [], i = 0; i < arguments.length; i++) {
49
- ar = ar.concat(__read(arguments[i]));
41
+ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
42
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
43
+ if (ar || !(i in from)) {
44
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
45
+ ar[i] = from[i];
46
+ }
50
47
  }
51
-
52
- return ar;
48
+ return to.concat(ar || Array.prototype.slice.call(from));
53
49
  };
54
-
55
50
  Object.defineProperty(exports, "__esModule", {
56
51
  value: true
57
52
  });
58
53
  exports.Emitter = void 0;
59
-
60
54
  var random_1 = require("../random");
61
-
62
- var Emitter =
63
- /** @class */
64
- function () {
55
+ var Emitter = /** @class */function () {
65
56
  function Emitter() {
66
57
  this.state = {};
67
58
  this.ids = {};
68
59
  }
69
-
70
60
  Emitter.prototype.on = function (event, func) {
71
61
  if (!this.state[event]) {
72
62
  this.state[event] = [];
73
63
  }
74
-
75
64
  if (typeof func !== 'function') {
76
65
  throw new Error('第二个参数必须为function!');
77
66
  }
78
-
79
67
  var index = this.state[event].push(func) - 1;
80
- var key = random_1.random(40);
68
+ var key = (0, random_1.random)(40);
81
69
  this.ids[key] = {
82
70
  event: event,
83
71
  index: index
84
72
  };
85
73
  return key;
86
74
  };
87
-
88
75
  Emitter.prototype.cancel = function (id) {
89
76
  var _this = this;
90
-
91
77
  if (!id) {
92
78
  this.clear();
93
79
  return;
94
80
  }
95
-
96
81
  var _a = this.ids[id] || {},
97
- event = _a.event,
98
- index = _a.index;
99
-
82
+ event = _a.event,
83
+ index = _a.index;
100
84
  if (!event) {
101
85
  return;
102
86
  }
103
-
104
87
  if (!Array.isArray(this.state[event])) {
105
88
  return;
106
89
  }
107
-
108
90
  this.state[event].splice(index, 1);
109
91
  delete this.ids[id];
110
92
  Object.keys(this.ids).forEach(function (key) {
@@ -113,27 +95,21 @@ function () {
113
95
  }
114
96
  });
115
97
  };
116
-
117
98
  Emitter.prototype.clear = function () {
118
99
  this.state.length = 0;
119
100
  };
120
-
121
101
  Emitter.prototype.emit = function (event) {
122
102
  var e_1, _a;
123
-
124
103
  var args = [];
125
-
126
104
  for (var _i = 1; _i < arguments.length; _i++) {
127
105
  args[_i - 1] = arguments[_i];
128
106
  }
129
-
130
107
  if (Array.isArray(this.state[event])) {
131
108
  try {
132
109
  for (var _b = __values(this.state[event]), _c = _b.next(); !_c.done; _c = _b.next()) {
133
110
  var func = _c.value;
134
-
135
111
  if (typeof func === 'function') {
136
- func.apply(void 0, __spread(args));
112
+ func.apply(void 0, __spreadArray([], __read(args), false));
137
113
  }
138
114
  }
139
115
  } catch (e_1_1) {
@@ -149,8 +125,6 @@ function () {
149
125
  }
150
126
  }
151
127
  };
152
-
153
128
  return Emitter;
154
129
  }();
155
-
156
130
  exports.Emitter = Emitter;
@@ -1,11 +1,11 @@
1
- declare type OptionsObject<T, C> = {
1
+ type OptionsObject<T, C> = {
2
2
  [key in keyof T]: C;
3
3
  };
4
- declare type ProductsObject<T, F> = {
4
+ type ProductsObject<T, F> = {
5
5
  [key in keyof T]: F;
6
6
  };
7
- declare type Factory<C> = (config: C, key: string) => any;
8
- export declare type CreateFactory<C, F> = <T>(apis: OptionsObject<T, C>) => ProductsObject<T, F>;
9
- export declare type SuperFactory = <C, F>(factory: Factory<C>) => CreateFactory<C, F>;
7
+ type Factory<C> = (config: C, key: string) => any;
8
+ export type CreateFactory<C, F> = <T>(apis: OptionsObject<T, C>) => ProductsObject<T, F>;
9
+ export type SuperFactory = <C, F>(factory: Factory<C>) => CreateFactory<C, F>;
10
10
  export declare const superFactory: SuperFactory;
11
11
  export {};
@@ -2,8 +2,8 @@
2
2
 
3
3
  var __values = this && this.__values || function (o) {
4
4
  var s = typeof Symbol === "function" && Symbol.iterator,
5
- m = s && o[s],
6
- i = 0;
5
+ m = s && o[s],
6
+ i = 0;
7
7
  if (m) return m.call(o);
8
8
  if (o && typeof o.length === "number") return {
9
9
  next: function next() {
@@ -16,18 +16,14 @@ var __values = this && this.__values || function (o) {
16
16
  };
17
17
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
18
18
  };
19
-
20
19
  Object.defineProperty(exports, "__esModule", {
21
20
  value: true
22
21
  });
23
22
  exports.superFactory = void 0;
24
-
25
- exports.superFactory = function (factory) {
23
+ var superFactory = function superFactory(factory) {
26
24
  return function (options) {
27
25
  var e_1, _a;
28
-
29
26
  var product = {};
30
-
31
27
  try {
32
28
  for (var _b = __values(Object.keys(options)), _c = _b.next(); !_c.done; _c = _b.next()) {
33
29
  var key = _c.value;
@@ -44,7 +40,7 @@ exports.superFactory = function (factory) {
44
40
  if (e_1) throw e_1.error;
45
41
  }
46
42
  }
47
-
48
43
  return product;
49
44
  };
50
- };
45
+ };
46
+ exports.superFactory = superFactory;
package/lib/index.d.ts CHANGED
@@ -14,3 +14,5 @@ export { WatchDog } from './watch-dog';
14
14
  export { Level } from './level';
15
15
  export { callbackToPromise } from './promise';
16
16
  export { getAngle, getDistance, getCenter, degrees, radians, filterKeyPoints } from './math/geometry';
17
+ export { RegExpList } from './regexp-list';
18
+ export { concatArray } from './array';