amos-tool 1.4.7 → 1.4.10

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 (103) hide show
  1. package/.prettierignore +2 -2
  2. package/.prettierrc +50 -50
  3. package/README.md +3 -0
  4. package/apis/objectPath.md +129 -129
  5. package/docs/Logger.html +160 -2
  6. package/docs/global.html +529 -65
  7. package/docs/index.html +5 -2
  8. package/index.d.ts +11 -2
  9. package/index.js +3 -3
  10. package/lib/_browser.js +10 -8
  11. package/lib/_clone.js +68 -57
  12. package/lib/_cookie.js +50 -47
  13. package/lib/_deepCopy.js +14 -19
  14. package/lib/_deepEqual.js +7 -8
  15. package/lib/_fastDeepEqual.js +26 -34
  16. package/lib/_flashSupport.js +13 -10
  17. package/lib/_forOwn.js +8 -7
  18. package/lib/_funcThrottle.js +16 -15
  19. package/lib/_isnode.js +2 -1
  20. package/lib/_list.js +74 -79
  21. package/lib/_object.assign.js +19 -19
  22. package/lib/_object.entries.js +8 -7
  23. package/lib/_object.values.js +8 -7
  24. package/lib/_omit.js +12 -11
  25. package/lib/_parseJson.js +7 -6
  26. package/lib/_pick.js +8 -7
  27. package/lib/_queue.js +24 -21
  28. package/lib/_shallowCopy.js +24 -23
  29. package/lib/_stringify.js +13 -10
  30. package/lib/_supportWs.js +5 -5
  31. package/lib/_trim.js +5 -4
  32. package/lib/_typeOfList.js +22 -21
  33. package/lib/_uuids.js +30 -35
  34. package/lib/amostool.js +4 -66
  35. package/lib/array2tree.js +9 -9
  36. package/lib/arrayFilter.js +18 -19
  37. package/lib/arrayUtils.js +10 -8
  38. package/lib/browser/Cookie.js +35 -36
  39. package/lib/browser/indexDB.js +72 -71
  40. package/lib/browserSupport.js +76 -71
  41. package/lib/completeUnit.js +7 -4
  42. package/lib/consts.js +2 -1
  43. package/lib/dom/canvas2img.js +61 -72
  44. package/lib/dom/canvasTools.js +11 -16
  45. package/lib/dom/downloadFile.js +17 -12
  46. package/lib/dom/eventHelper.js +8 -6
  47. package/lib/dom/fileBlob.js +14 -14
  48. package/lib/dom/fileSaveAs.js +54 -61
  49. package/lib/dom/getFontSize.js +7 -10
  50. package/lib/dom/minfyImg.js +27 -24
  51. package/lib/encrypt/_base64.js +32 -25
  52. package/lib/encrypt/_md5.js +68 -31
  53. package/lib/encrypt/des.js +430 -366
  54. package/lib/extra/_common.js +120 -161
  55. package/lib/extra/filterNull.js +5 -4
  56. package/lib/extra/find.js +10 -11
  57. package/lib/extra/index.js +4 -3
  58. package/lib/extra/memo.js +18 -0
  59. package/lib/extra/pathToTree.js +49 -36
  60. package/lib/extra/pwdStrength.js +4 -2
  61. package/lib/extra/sortBy.js +28 -30
  62. package/lib/flat.js +9 -13
  63. package/lib/locationParams.js +93 -95
  64. package/lib/log.js +23 -26
  65. package/lib/math/_keyColor.js +3 -1
  66. package/lib/math/addition.js +9 -7
  67. package/lib/math/amountCase.js +8 -12
  68. package/lib/math/coinFormat.js +6 -4
  69. package/lib/math/colorUtil.js +91 -94
  70. package/lib/math/dateTime.js +79 -97
  71. package/lib/math/operations.js +33 -37
  72. package/lib/math/pwdStrength.js +4 -2
  73. package/lib/math/randomColor.js +17 -5
  74. package/lib/math/subtraction.js +10 -9
  75. package/lib/merged.js +9 -9
  76. package/lib/objectPath.js +81 -82
  77. package/lib/parseText.js +8 -7
  78. package/lib/png/Identicon.js +32 -28
  79. package/lib/png/pnglib.js +59 -34
  80. package/lib/png/randomPic.js +8 -14
  81. package/lib/positionFactory.js +28 -28
  82. package/lib/pwdPolicy.js +27 -31
  83. package/lib/qs/_assign.js +7 -5
  84. package/lib/qs/_merge.js +20 -23
  85. package/lib/qs/_tools.js +3 -2
  86. package/lib/qs/formats.js +6 -5
  87. package/lib/qs/index.js +4 -4
  88. package/lib/qs/parse.js +56 -51
  89. package/lib/qs/stringify.js +54 -69
  90. package/lib/qs/utils.js +70 -83
  91. package/lib/random.js +5 -4
  92. package/lib/shallowEqual.js +25 -29
  93. package/lib/store.js +93 -95
  94. package/lib/strUtils.js +52 -43
  95. package/lib/tableFilter.js +178 -169
  96. package/lib/throttleDebounce.js +18 -22
  97. package/lib/url/encodeUrl.js +5 -4
  98. package/lib/url/restfulUrl.js +8 -7
  99. package/lib/utils.js +170 -222
  100. package/lib/xss/htmlEncode.js +3 -2
  101. package/lib/xss/implementEncode.js +36 -37
  102. package/lib/xss/index.js +4 -3
  103. package/package.json +4 -4
package/lib/parseText.js CHANGED
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
- var utils = require("./utils"),
3
- defaultRE = /\{((?:.|\n)+?)\}/g;
4
- module.exports = function(e, u, t) {
5
- return t = t || defaultRE, e && e.replace ? e.replace(t, function(e, t) {
6
- return utils.isUndefined(u[t]) ? e : u[t]
7
- }) : e
8
- };
2
+
3
+ var utils = require("./utils"), defaultRE = /\{((?:.|\n)+?)\}/g;
4
+
5
+ module.exports = function(e, t, u) {
6
+ return u || (u = defaultRE), e && e.replace ? e.replace(u, (function(e, u) {
7
+ return utils.isUndefined(t[u]) ? e : t[u];
8
+ })) : e;
9
+ };
@@ -1,43 +1,46 @@
1
1
  "use strict";
2
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"),
3
- _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")),
4
- PNGlib = require("./pnglib"),
5
- Svg = function(t, i, e) {
6
- this.size = t, this.foreground = this.color.apply(this, i), this.background = this.color.apply(this, e), this.rectangles = []
7
- };
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"), _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")), PNGlib = require("./pnglib"), Svg = function(t, i, e) {
4
+ this.size = t, this.foreground = this.color.apply(this, i), this.background = this.color.apply(this, e),
5
+ this.rectangles = [];
6
+ };
8
7
 
9
8
  function Identicon(t, i) {
10
9
  if ("string" != typeof t || t.length < 15) throw "A hash of at least 15 characters is required.";
11
10
  this.defaults = {
12
- background: [240, 240, 240, 255],
11
+ background: [ 240, 240, 240, 255 ],
13
12
  margin: .08,
14
13
  size: 64,
15
14
  saturation: .7,
16
15
  brightness: .5,
17
16
  format: "png"
18
- }, this.options = "object" === (0, _typeof2.default)(i) ? i : this.defaults, "number" == typeof i && (this.options.size = i), arguments[2] && (this.options.margin = arguments[2]), this.hash = t, this.background = this.options.background || this.defaults.background, this.size = this.options.size || this.defaults.size, this.format = this.options.format || this.defaults.format, this.margin = (void 0 !== this.options.margin ? this.options : this.defaults).margin;
19
- var e = parseInt(this.hash.substr(-7), 16) / 268435455,
20
- i = this.options.saturation || this.defaults.saturation,
21
- t = this.options.brightness || this.defaults.brightness;
22
- this.foreground = this.options.foreground || this.hsl2rgb(e, i, t)
17
+ }, this.options = "object" === (0, _typeof2.default)(i) ? i : this.defaults, "number" == typeof arguments[1] && (this.options.size = arguments[1]),
18
+ arguments[2] && (this.options.margin = arguments[2]), this.hash = t, this.background = this.options.background || this.defaults.background,
19
+ this.size = this.options.size || this.defaults.size, this.format = this.options.format || this.defaults.format,
20
+ this.margin = void 0 !== this.options.margin ? this.options.margin : this.defaults.margin;
21
+ var e = parseInt(this.hash.substr(-7), 16) / 268435455, s = this.options.saturation || this.defaults.saturation, r = this.options.brightness || this.defaults.brightness;
22
+ this.foreground = this.options.foreground || this.hsl2rgb(e, s, r);
23
23
  }
24
+
24
25
  Svg.prototype = {
25
26
  size: null,
26
27
  foreground: null,
27
28
  background: null,
28
29
  rectangles: null,
29
30
  color: function(t, i, e, s) {
30
- e = [t, i, e].map(Math.round);
31
- return e.push(0 <= s && s <= 255 ? s / 255 : 1), "rgba(" + e.join(",") + ")"
31
+ var r = [ t, i, e ].map(Math.round);
32
+ return r.push(s >= 0 && s <= 255 ? s / 255 : 1), "rgba(" + r.join(",") + ")";
32
33
  },
33
34
  getDump: function() {
34
- for (var t, i = this.foreground, e = this.background, s = .005 * this.size, r = "<svg xmlns='http://www.w3.org/2000/svg' width='" + this.size + "' height='" + this.size + "' style='background-color:" + e + ";'><g style='fill:" + i + "; stroke:" + i + "; stroke-width:" + s + ";'>", n = 0; n < this.rectangles.length; n++)(t = this.rectangles[n]).color != e && (r += "<rect x='" + t.x + "' y='" + t.y + "' width='" + t.w + "' height='" + t.h + "'/>");
35
- return r += "</g></svg>"
35
+ var t, i, e, s = this.foreground, r = this.background, n = .005 * this.size;
36
+ for (i = "<svg xmlns='http://www.w3.org/2000/svg' width='" + this.size + "' height='" + this.size + "' style='background-color:" + r + ";'><g style='fill:" + s + "; stroke:" + s + "; stroke-width:" + n + ";'>",
37
+ t = 0; t < this.rectangles.length; t++) (e = this.rectangles[t]).color != r && (i += "<rect x='" + e.x + "' y='" + e.y + "' width='" + e.w + "' height='" + e.h + "'/>");
38
+ return i += "</g></svg>";
36
39
  },
37
40
  getBase64: function() {
38
41
  if ("function" == typeof btoa) return btoa(this.getDump());
39
42
  if (Buffer) return new Buffer(this.getDump(), "binary").toString("base64");
40
- throw "Cannot generate base64 output"
43
+ throw "Cannot generate base64 output";
41
44
  }
42
45
  }, Identicon.prototype = {
43
46
  background: null,
@@ -47,31 +50,32 @@ Svg.prototype = {
47
50
  size: null,
48
51
  format: null,
49
52
  image: function() {
50
- return this.isSvg() ? new Svg(this.size, this.foreground, this.background) : new PNGlib(this.size, this.size, 256)
53
+ return this.isSvg() ? new Svg(this.size, this.foreground, this.background) : new PNGlib(this.size, this.size, 256);
51
54
  },
52
55
  render: function() {
53
- for (var t, i = this.image(), e = this.size, s = Math.floor(e * this.margin), r = Math.floor((e - 2 * s) / 5), n = Math.floor((e - 5 * r) / 2), o = i.color.apply(i, this.background), h = i.color.apply(i, this.foreground), a = 0; a < 15; a++) t = parseInt(this.hash.charAt(a), 16) % 2 ? o : h, a < 5 ? this.rectangle(2 * r + n, a * r + n, r, r, t, i) : a < 10 ? (this.rectangle(+r + n, (a - 5) * r + n, r, r, t, i), this.rectangle(3 * r + n, (a - 5) * r + n, r, r, t, i)) : a < 15 && (this.rectangle(0 * r + n, (a - 10) * r + n, r, r, t, i), this.rectangle(4 * r + n, (a - 10) * r + n, r, r, t, i));
54
- return i
56
+ var t, i, e = this.image(), s = this.size, r = Math.floor(s * this.margin), n = Math.floor((s - 2 * r) / 5), o = Math.floor((s - 5 * n) / 2), h = e.color.apply(e, this.background), a = e.color.apply(e, this.foreground);
57
+ for (t = 0; t < 15; t++) i = parseInt(this.hash.charAt(t), 16) % 2 ? h : a, t < 5 ? this.rectangle(2 * n + o, t * n + o, n, n, i, e) : t < 10 ? (this.rectangle(1 * n + o, (t - 5) * n + o, n, n, i, e),
58
+ this.rectangle(3 * n + o, (t - 5) * n + o, n, n, i, e)) : t < 15 && (this.rectangle(0 * n + o, (t - 10) * n + o, n, n, i, e),
59
+ this.rectangle(4 * n + o, (t - 10) * n + o, n, n, i, e));
60
+ return e;
55
61
  },
56
62
  rectangle: function(t, i, e, s, r, n) {
63
+ var o, h;
57
64
  if (this.isSvg()) n.rectangles.push({
58
65
  x: t,
59
66
  y: i,
60
67
  w: e,
61
68
  h: s,
62
69
  color: r
63
- });
64
- else
65
- for (var o, h = t; h < t + e; h++)
66
- for (o = i; o < i + s; o++) n.buffer[n.index(h, o)] = r
70
+ }); else for (o = t; o < t + e; o++) for (h = i; h < i + s; h++) n.buffer[n.index(o, h)] = r;
67
71
  },
68
72
  hsl2rgb: function(t, i, e) {
69
- return [255 * (i = [e += i *= e < .5 ? e : 1 - e, e - (t *= 6) % 1 * i * 2, e -= i *= 2, e, e + t % 1 * i, e + i])[~~t % 6], 255 * i[(16 | t) % 6], 255 * i[(8 | t) % 6]]
73
+ return [ 255 * (i = [ e += i *= e < .5 ? e : 1 - e, e - (t *= 6) % 1 * i * 2, e -= i *= 2, e, e + t % 1 * i, e + i ])[~~t % 6], 255 * i[(16 | t) % 6], 255 * i[(8 | t) % 6] ];
70
74
  },
71
75
  toString: function(t) {
72
- return t ? this.render().getDump() : this.render().getBase64()
76
+ return t ? this.render().getDump() : this.render().getBase64();
73
77
  },
74
78
  isSvg: function() {
75
- return this.format.match(/svg/i)
79
+ return this.format.match(/svg/i);
76
80
  }
77
- }, module.exports = Identicon;
81
+ }, module.exports = Identicon;
package/lib/png/pnglib.js CHANGED
@@ -1,58 +1,83 @@
1
1
  "use strict";
2
2
 
3
- function write(t, i) {
4
- for (var s = 2; s < arguments.length; s++)
5
- for (var e = 0; e < arguments[s].length; e++) t[i++] = arguments[s].charAt(e)
3
+ /**
4
+ * A handy class to calculate color values.
5
+ *
6
+ * @version 1.0
7
+ * @author Robert Eisele <robert@xarg.org>
8
+ * @copyright Copyright (c) 2010, Robert Eisele
9
+ * @link http://www.xarg.org/2010/03/generate-client-side-png-files-using-javascript/
10
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
11
+ *
12
+ */ function write(t, i) {
13
+ for (var s = 2; s < arguments.length; s++) for (var e = 0; e < arguments[s].length; e++) t[i++] = arguments[s].charAt(e);
6
14
  }
7
15
 
8
16
  function byte2(t) {
9
- return String.fromCharCode(t >> 8 & 255, 255 & t)
17
+ return String.fromCharCode(t >> 8 & 255, 255 & t);
10
18
  }
11
19
 
12
20
  function byte4(t) {
13
- return String.fromCharCode(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, 255 & t)
21
+ return String.fromCharCode(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, 255 & t);
14
22
  }
15
23
 
16
24
  function byte2lsb(t) {
17
- return String.fromCharCode(255 & t, t >> 8 & 255)
25
+ return String.fromCharCode(255 & t, t >> 8 & 255);
18
26
  }
27
+
19
28
  module.exports = function(t, i, s) {
20
- this.width = t, this.height = i, this.depth = s, this.pix_size = i * (t + 1), this.data_size = 2 + this.pix_size + 5 * Math.floor((65534 + this.pix_size) / 65535) + 4, this.ihdr_offs = 0, this.ihdr_size = 25, this.plte_offs = this.ihdr_offs + this.ihdr_size, this.plte_size = 8 + 3 * s + 4, this.trns_offs = this.plte_offs + this.plte_size, this.trns_size = 8 + s + 4, this.idat_offs = this.trns_offs + this.trns_size, this.idat_size = 8 + this.data_size + 4, this.iend_offs = this.idat_offs + this.idat_size, this.iend_size = 12, this.buffer_size = this.iend_offs + this.iend_size, this.buffer = new Array, this.palette = new Object, this.pindex = 0;
21
- for (var o = new Array, e = 0; e < this.buffer_size; e++) this.buffer[e] = "\0";
22
- write(this.buffer, this.ihdr_offs, byte4(this.ihdr_size - 12), "IHDR", byte4(t), byte4(i), "\b"), write(this.buffer, this.plte_offs, byte4(this.plte_size - 12), "PLTE"), write(this.buffer, this.trns_offs, byte4(this.trns_size - 12), "tRNS"), write(this.buffer, this.idat_offs, byte4(this.idat_size - 12), "IDAT"), write(this.buffer, this.iend_offs, byte4(this.iend_size - 12), "IEND");
23
- i = 30912;
24
- i += 26, write(this.buffer, this.idat_offs + 8, byte2(30938));
25
- for (e = 0;
26
- (e << 16) - 1 < this.pix_size; e++) {
27
- var h, r = e + 65535 < this.pix_size ? (h = 65535, "\0") : (h = this.pix_size - (e << 16) - e, "");
28
- write(this.buffer, this.idat_offs + 8 + 2 + (e << 16) + (e << 2), r, byte2lsb(h), byte2lsb(~h))
29
+ this.width = t, this.height = i, this.depth = s, this.pix_size = i * (t + 1), this.data_size = 2 + this.pix_size + 5 * Math.floor((65534 + this.pix_size) / 65535) + 4,
30
+ this.ihdr_offs = 0, this.ihdr_size = 25, this.plte_offs = this.ihdr_offs + this.ihdr_size,
31
+ this.plte_size = 8 + 3 * s + 4, this.trns_offs = this.plte_offs + this.plte_size,
32
+ this.trns_size = 8 + s + 4, this.idat_offs = this.trns_offs + this.trns_size, this.idat_size = 8 + this.data_size + 4,
33
+ this.iend_offs = this.idat_offs + this.idat_size, this.iend_size = 12, this.buffer_size = this.iend_offs + this.iend_size,
34
+ this.buffer = new Array, this.palette = new Object, this.pindex = 0;
35
+ for (var e = new Array, h = 0; h < this.buffer_size; h++) this.buffer[h] = "\0";
36
+ write(this.buffer, this.ihdr_offs, byte4(this.ihdr_size - 12), "IHDR", byte4(t), byte4(i), "\b"),
37
+ write(this.buffer, this.plte_offs, byte4(this.plte_size - 12), "PLTE"), write(this.buffer, this.trns_offs, byte4(this.trns_size - 12), "tRNS"),
38
+ write(this.buffer, this.idat_offs, byte4(this.idat_size - 12), "IDAT"), write(this.buffer, this.iend_offs, byte4(this.iend_size - 12), "IEND");
39
+ var r = 30912;
40
+ r += 31 - r % 31, write(this.buffer, this.idat_offs + 8, byte2(r));
41
+ for (h = 0; (h << 16) - 1 < this.pix_size; h++) {
42
+ var f, o;
43
+ h + 65535 < this.pix_size ? (f = 65535, o = "\0") : (f = this.pix_size - (h << 16) - h,
44
+ o = ""), write(this.buffer, this.idat_offs + 8 + 2 + (h << 16) + (h << 2), o, byte2lsb(f), byte2lsb(~f));
29
45
  }
30
- for (e = 0; e < 256; e++) {
31
- for (var f = e, n = 0; n < 8; n++) f = 1 & f ? -306674912 ^ f >> 1 & 2147483647 : f >> 1 & 2147483647;
32
- o[e] = f
46
+ for (h = 0; h < 256; h++) {
47
+ for (var n = h, d = 0; d < 8; d++) n = 1 & n ? -306674912 ^ n >> 1 & 2147483647 : n >> 1 & 2147483647;
48
+ e[h] = n;
33
49
  }
34
50
  this.index = function(t, i) {
35
- t = i * (this.width + 1) + t + 1;
36
- return this.idat_offs + 8 + 2 + 5 * Math.floor(t / 65535 + 1) + t
51
+ var s = i * (this.width + 1) + t + 1;
52
+ return this.idat_offs + 8 + 2 + 5 * Math.floor(s / 65535 + 1) + s;
37
53
  }, this.color = function(t, i, s, e) {
38
- var h = (((e = 0 <= e ? e : 255) << 8 | t) << 8 | i) << 8 | s;
54
+ var h = (((e = e >= 0 ? e : 255) << 8 | t) << 8 | i) << 8 | s;
39
55
  if (void 0 === this.palette[h]) {
40
56
  if (this.pindex == this.depth) return "\0";
41
57
  var r = this.plte_offs + 8 + 3 * this.pindex;
42
- this.buffer[r + 0] = String.fromCharCode(t), this.buffer[r + 1] = String.fromCharCode(i), this.buffer[r + 2] = String.fromCharCode(s), this.buffer[this.trns_offs + 8 + this.pindex] = String.fromCharCode(e), this.palette[h] = String.fromCharCode(this.pindex++)
58
+ this.buffer[r + 0] = String.fromCharCode(t), this.buffer[r + 1] = String.fromCharCode(i),
59
+ this.buffer[r + 2] = String.fromCharCode(s), this.buffer[this.trns_offs + 8 + this.pindex] = String.fromCharCode(e),
60
+ this.palette[h] = String.fromCharCode(this.pindex++);
43
61
  }
44
- return this.palette[h]
62
+ return this.palette[h];
45
63
  }, this.getBase64 = function() {
46
- for (var t, i, s, e, h = this.getDump(), r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", f = h.length, o = 0, n = ""; t = (e = h.charCodeAt(o)) >> 2, i = (3 & e) << 4 | (s = h.charCodeAt(o + 1)) >> 4, e = h.charCodeAt(o + 2), s = f < o + 2 ? 64 : (15 & s) << 2 | e >> 6, e = f < o + 3 ? 64 : 63 & e, n += r.charAt(t) + r.charAt(i) + r.charAt(s) + r.charAt(e), (o += 3) < f;);
47
- return n
64
+ var t, i, s, e, h, r, f, o = this.getDump(), n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", d = o.length, a = 0, _ = "";
65
+ do {
66
+ e = (t = o.charCodeAt(a)) >> 2, h = (3 & t) << 4 | (i = o.charCodeAt(a + 1)) >> 4,
67
+ s = o.charCodeAt(a + 2), r = d < a + 2 ? 64 : (15 & i) << 2 | s >> 6, f = d < a + 3 ? 64 : 63 & s,
68
+ _ += n.charAt(e) + n.charAt(h) + n.charAt(r) + n.charAt(f);
69
+ } while ((a += 3) < d);
70
+ return _;
48
71
  }, this.getDump = function() {
49
- for (var t = 65521, i = 1, s = 0, e = 5552, h = 0; h < this.height; h++)
50
- for (var r = -1; r < this.width; r++) s += i += this.buffer[this.index(r, h)].charCodeAt(0), 0 == --e && (i %= t, s %= t, e = 5552);
51
-
52
- function f(t, i, s) {
53
- for (var e = -1, h = 4; h < s - 4; h += 1) e = o[255 & (e ^ t[i + h].charCodeAt(0))] ^ e >> 8 & 16777215;
54
- write(t, i + s - 4, byte4(-1 ^ e))
72
+ for (var t = 65521, i = 1, s = 0, h = 5552, r = 0; r < this.height; r++) for (var f = -1; f < this.width; f++) s += i += this.buffer[this.index(f, r)].charCodeAt(0),
73
+ 0 == (h -= 1) && (i %= t, s %= t, h = 5552);
74
+ function o(t, i, s) {
75
+ for (var h = -1, r = 4; r < s - 4; r += 1) h = e[255 & (h ^ t[i + r].charCodeAt(0))] ^ h >> 8 & 16777215;
76
+ write(t, i + s - 4, byte4(-1 ^ h));
55
77
  }
56
- return i %= t, s %= t, write(this.buffer, this.idat_offs + this.idat_size - 8, byte4(s << 16 | i)), f(this.buffer, this.ihdr_offs, this.ihdr_size), f(this.buffer, this.plte_offs, this.plte_size), f(this.buffer, this.trns_offs, this.trns_size), f(this.buffer, this.idat_offs, this.idat_size), f(this.buffer, this.iend_offs, this.iend_size), "‰PNG\r\n\n" + this.buffer.join("")
57
- }
58
- };
78
+ return i %= t, s %= t, write(this.buffer, this.idat_offs + this.idat_size - 8, byte4(s << 16 | i)),
79
+ o(this.buffer, this.ihdr_offs, this.ihdr_size), o(this.buffer, this.plte_offs, this.plte_size),
80
+ o(this.buffer, this.trns_offs, this.trns_size), o(this.buffer, this.idat_offs, this.idat_size),
81
+ o(this.buffer, this.iend_offs, this.iend_size), "‰PNG\r\n\n" + this.buffer.join("");
82
+ };
83
+ };
@@ -1,21 +1,15 @@
1
1
  "use strict";
2
- var md5 = require("./../encrypt/_md5"),
3
- Identicon = require("./Identicon");
2
+
3
+ var md5 = require("./../encrypt/_md5"), Identicon = require("./Identicon");
4
4
 
5
5
  function randomWord(n, o, r) {
6
- var t = "",
7
- e = o,
8
- d = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
6
+ var t = "", e = o, d = [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ];
9
7
  n && (e = Math.round(Math.random() * (r - o)) + o);
10
8
  for (var a = 0; a < e; a++) pos = Math.round(Math.random() * (d.length - 1)), t += d[pos];
11
- return t
9
+ return t;
12
10
  }
11
+
13
12
  module.exports = function() {
14
- var n = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "amos-tool",
15
- o = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 16,
16
- r = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : 16,
17
- t = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : 420,
18
- r = randomWord(n, o, r),
19
- r = md5(r);
20
- return "data:image/png;base64," + new Identicon(r, t).toString()
21
- };
13
+ var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "amos-tool", o = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 16, r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 16, t = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 420, e = randomWord(n, o, r), d = md5(e), a = new Identicon(d, t).toString(), i = "data:image/png;base64," + a;
14
+ return i;
15
+ };
@@ -1,59 +1,59 @@
1
1
  "use strict";
2
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"),
3
- _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")),
4
- _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"), _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")), _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
5
4
 
6
5
  function getDocumentScroll() {
7
- var t = document,
8
- e = t.documentElement,
9
- t = t.body;
10
- return [e && e.scrollTop || t.scrollTop, e && e.scrollLeft || t.scrollLeft]
6
+ var t = document, e = t.documentElement, i = t.body;
7
+ return [ e && e.scrollTop || i.scrollTop, e && e.scrollLeft || i.scrollLeft ];
11
8
  }
12
9
 
13
10
  function PositionFactory(t, e, i, r, n) {
14
- var o = getDocumentScroll(),
15
- c = (0, _slicedToArray2.default)(o, 2),
16
- l = c[0],
17
- o = c[1],
18
- c = PositionFactory;
19
- return c.triggerRect = t.getBoundingClientRect(), c.popoverRect = e.getBoundingClientRect(), c.direction = c.getComputedDirection(i), c.align = c.getComputedAlign(r), c.center = [c.triggerRect.left + c.triggerRect.width / 2 + o, c.triggerRect.top + c.triggerRect.height / 2 + l], n || (l = c.coordinateMap[c.direction].call(c), l = (n = (0, _slicedToArray2.default)(l, 2))[0], n = n[1], e.style.left = "".concat(l, "px"), e.style.top = "".concat(n, "px")), [c.direction, c.align]
20
- }(0, _extends2.default)(PositionFactory, {
11
+ var o = getDocumentScroll(), c = (0, _slicedToArray2.default)(o, 2), l = c[0], g = c[1], u = PositionFactory;
12
+ if (u.triggerRect = t.getBoundingClientRect(), u.popoverRect = e.getBoundingClientRect(),
13
+ u.direction = u.getComputedDirection(i), u.align = u.getComputedAlign(r), u.center = [ u.triggerRect.left + u.triggerRect.width / 2 + g, u.triggerRect.top + u.triggerRect.height / 2 + l ],
14
+ !n) {
15
+ var s = u.coordinateMap[u.direction].call(u), h = (0, _slicedToArray2.default)(s, 2), d = h[0], p = h[1];
16
+ e.style.left = "".concat(d, "px"), e.style.top = "".concat(p, "px");
17
+ }
18
+ return [ u.direction, u.align ];
19
+ }
20
+
21
+ (0, _extends2.default)(PositionFactory, {
21
22
  triggerRect: null,
22
23
  popoverRect: null,
23
24
  align: null,
24
25
  center: null,
25
26
  getComputedDirection: function(t) {
26
- var e = this.triggerRect,
27
- i = this.popoverRect;
28
- return "up" !== t && "down" !== t || (e.top < i.height ? t = "down" : i.height + e.top + e.height > window.innerHeight && (t = "up")), t
27
+ var e = this.triggerRect, i = this.popoverRect;
28
+ return "up" !== t && "down" !== t || (e.top < i.height ? t = "down" : i.height + e.top + e.height > window.innerHeight && (t = "up")),
29
+ t;
29
30
  },
30
31
  getComputedAlign: function(t) {
31
32
  if ("middle" === t) return t;
32
33
  if ("up" === this.direction || "down" === this.direction) {
33
- if ("top" === t || "bottom" === t) return "middle"
34
+ if ("top" === t || "bottom" === t) return "middle";
34
35
  } else if ("left" === t || "right" === t) return "middle";
35
- return t
36
+ return t;
36
37
  },
37
38
  getAlignPosition: function(t) {
38
- var e = t ? ["left", "right"] : ["top", "bottom"],
39
- i = t ? 0 : 1,
40
- t = t ? "width" : "height";
41
- return this.align === e[0] ? this.center[i] - this.triggerRect[t] / 2 : this.align === e[1] ? this.center[i] - this.popoverRect[t] + this.triggerRect[t] / 2 : this.center[i] - this.popoverRect[t] / 2
39
+ var e = t ? [ "left", "right" ] : [ "top", "bottom" ], i = t ? 0 : 1, r = t ? "width" : "height";
40
+ return this.align === e[0] ? this.center[i] - this.triggerRect[r] / 2 : this.align === e[1] ? this.center[i] - this.popoverRect[r] + this.triggerRect[r] / 2 : this.center[i] - this.popoverRect[r] / 2;
42
41
  },
43
42
  coordinateMap: {
44
43
  up: function() {
45
44
  var t = this.center[1] - this.triggerRect.height / 2 - this.popoverRect.height;
46
- return [this.getAlignPosition(!0), t]
45
+ return [ this.getAlignPosition(!0), t ];
47
46
  },
48
47
  down: function() {
49
48
  var t = this.center[1] + this.triggerRect.height / 2;
50
- return [this.getAlignPosition(!0), t]
49
+ return [ this.getAlignPosition(!0), t ];
51
50
  },
52
51
  left: function() {
53
- return [this.center[0] - this.triggerRect.width / 2 - this.popoverRect.width, this.getAlignPosition()]
52
+ var t = this.center[0] - this.triggerRect.width / 2 - this.popoverRect.width;
53
+ return [ t, this.getAlignPosition() ];
54
54
  },
55
55
  right: function() {
56
- return [this.center[0] + this.triggerRect.width / 2, this.getAlignPosition()]
56
+ return [ this.center[0] + this.triggerRect.width / 2, this.getAlignPosition() ];
57
57
  }
58
58
  }
59
- }), module.exports = PositionFactory;
59
+ }), module.exports = PositionFactory;
package/lib/pwdPolicy.js CHANGED
@@ -1,38 +1,34 @@
1
1
  "use strict";
2
- var _uuid = require("./_uuids"),
3
- Store = require("./store"),
4
- md5 = require("./encrypt/_md5"),
5
- normalPolicy = function(e) {
6
- e = e || "";
7
- var u = _uuid.uuid(16);
8
- return e += u, {
9
- password: Store.encrypt(e),
10
- secretKey: u
11
- }
12
- },
13
- advancePolicy = function(e, u) {
14
- return e = e || "", e += u = u || _uuid.uuid(32), {
15
- password: Store.encrypt(e),
16
- secretKey: u
17
- }
18
- },
19
- useMd5Policy = function(e, u) {
20
- return e = e || "", u = u || _uuid.uuid(32), {
21
- password: md5(e, u),
22
- secretKey: u
23
- }
24
- },
25
- useMd5Policy2 = function(e, u) {
26
- e = e || "", u = u || _uuid.uuid(32);
27
- e = md5(e);
28
- return e += u, {
29
- password: Store.encrypt(e),
30
- secretKey: u
31
- }
2
+
3
+ var _uuid = require("./_uuids"), Store = require("./store"), md5 = require("./encrypt/_md5"), normalPolicy = function(e) {
4
+ e || (e = "");
5
+ var r = _uuid.uuid(16);
6
+ return e += r, {
7
+ password: Store.encrypt(e),
8
+ secretKey: r
32
9
  };
10
+ }, advancePolicy = function(e, r) {
11
+ return e || (e = ""), r || (r = _uuid.uuid(32)), e += r, {
12
+ password: Store.encrypt(e),
13
+ secretKey: r
14
+ };
15
+ }, useMd5Policy = function(e, r) {
16
+ return e || (e = ""), r || (r = _uuid.uuid(32)), {
17
+ password: md5(e, r),
18
+ secretKey: r
19
+ };
20
+ }, useMd5Policy2 = function(e, r) {
21
+ e || (e = ""), r || (r = _uuid.uuid(32));
22
+ var u = md5(e);
23
+ return u += r, {
24
+ password: Store.encrypt(u),
25
+ secretKey: r
26
+ };
27
+ };
28
+
33
29
  module.exports = {
34
30
  normalPolicy: normalPolicy,
35
31
  advancePolicy: advancePolicy,
36
32
  useMd5Policy: useMd5Policy,
37
33
  useMd5Policy2: useMd5Policy2
38
- };
34
+ };
package/lib/qs/_assign.js CHANGED
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
- var assign = function(e, r) {
3
- return Object.keys(r).reduce(function(e, n) {
4
- return e[n] = r[n], e
5
- }, e)
2
+
3
+ var assign = function(e, n) {
4
+ return Object.keys(n).reduce((function(e, r) {
5
+ return e[r] = n[r], e;
6
+ }), e);
6
7
  };
7
- module.exports = assign;
8
+
9
+ module.exports = assign;
package/lib/qs/_merge.js CHANGED
@@ -1,25 +1,22 @@
1
1
  "use strict";
2
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"),
3
- _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")),
4
- arrayToObject = require("./_tools").arrayToObject,
5
- has = Object.prototype.hasOwnProperty,
6
- merge = function a(t, o, u) {
7
- if (!o) return t;
8
- if ("object" !== (0, _typeof2.default)(o)) {
9
- if (Array.isArray(t)) t.push(o);
10
- else {
11
- if ("object" !== (0, _typeof2.default)(t)) return [t, o];
12
- !u.plainObjects && !u.allowPrototypes && has.call(Object.prototype, o) || (t[o] = !0)
13
- }
14
- return t
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"), _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")), arrayToObject = require("./_tools").arrayToObject, has = Object.prototype.hasOwnProperty, merge = function e(r, t, a) {
4
+ if (!t) return r;
5
+ if ("object" !== (0, _typeof2.default)(t)) {
6
+ if (Array.isArray(r)) r.push(t); else {
7
+ if ("object" !== (0, _typeof2.default)(r)) return [ r, t ];
8
+ (a.plainObjects || a.allowPrototypes || !has.call(Object.prototype, t)) && (r[t] = !0);
15
9
  }
16
- if ("object" !== (0, _typeof2.default)(t)) return [t].concat(o);
17
- var e = t;
18
- return Array.isArray(t) && !Array.isArray(o) && (e = arrayToObject(t, u)), Array.isArray(t) && Array.isArray(o) ? (o.forEach(function(e, r) {
19
- has.call(t, r) ? t[r] && "object" === (0, _typeof2.default)(t[r]) ? t[r] = a(t[r], e, u) : t.push(e) : t[r] = e
20
- }), t) : Object.keys(o).reduce(function(e, r) {
21
- var t = o[r];
22
- return has.call(e, r) ? e[r] = a(e[r], t, u) : e[r] = t, e
23
- }, e)
24
- };
25
- module.exports = merge;
10
+ return r;
11
+ }
12
+ if ("object" !== (0, _typeof2.default)(r)) return [ r ].concat(t);
13
+ var o = r;
14
+ return Array.isArray(r) && !Array.isArray(t) && (o = arrayToObject(r, a)), Array.isArray(r) && Array.isArray(t) ? (t.forEach((function(t, o) {
15
+ has.call(r, o) ? r[o] && "object" === (0, _typeof2.default)(r[o]) ? r[o] = e(r[o], t, a) : r.push(t) : r[o] = t;
16
+ })), r) : Object.keys(t).reduce((function(r, o) {
17
+ var u = t[o];
18
+ return has.call(r, o) ? r[o] = e(r[o], u, a) : r[o] = u, r;
19
+ }), o);
20
+ };
21
+
22
+ module.exports = merge;
package/lib/qs/_tools.js CHANGED
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
+
2
3
  module.exports = {
3
4
  arrayToObject: function(e, t) {
4
5
  for (var r = t && t.plainObjects ? Object.create(null) : {}, c = 0; c < e.length; ++c) void 0 !== e[c] && (r[c] = e[c]);
5
- return r
6
+ return r;
6
7
  }
7
- };
8
+ };
package/lib/qs/formats.js CHANGED
@@ -1,16 +1,17 @@
1
1
  "use strict";
2
- var replace = String.prototype.replace,
3
- percentTwenties = /%20/g;
2
+
3
+ var replace = String.prototype.replace, percentTwenties = /%20/g;
4
+
4
5
  module.exports = {
5
6
  default: "RFC3986",
6
7
  formatters: {
7
8
  RFC1738: function(e) {
8
- return replace.call(e, percentTwenties, "+")
9
+ return replace.call(e, percentTwenties, "+");
9
10
  },
10
11
  RFC3986: function(e) {
11
- return e
12
+ return e;
12
13
  }
13
14
  },
14
15
  RFC1738: "RFC1738",
15
16
  RFC3986: "RFC3986"
16
- };
17
+ };
package/lib/qs/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
- var stringify = require("./stringify"),
3
- parse = require("./parse"),
4
- formats = require("./formats");
2
+
3
+ var stringify = require("./stringify"), parse = require("./parse"), formats = require("./formats");
4
+
5
5
  module.exports = {
6
6
  formats: formats,
7
7
  parse: parse,
8
8
  stringify: stringify
9
- };
9
+ };