amos-tool 1.4.4 → 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/.prettierignore +2 -2
- package/.prettierrc +50 -50
- package/README.md +667 -653
- package/apis/objectPath.md +129 -129
- package/index.d.ts +50 -5
- package/index.js +3 -3
- package/lib/_browser.js +10 -8
- package/lib/_clone.js +67 -62
- package/lib/_cookie.js +35 -32
- package/lib/_deepCopy.js +17 -29
- package/lib/_deepEqual.js +6 -13
- package/lib/_fastDeepEqual.js +28 -44
- package/lib/_flashSupport.js +13 -10
- package/lib/_forOwn.js +8 -7
- package/lib/_funcThrottle.js +16 -15
- package/lib/_isnode.js +2 -1
- package/lib/_list.js +55 -67
- package/lib/_object.assign.js +14 -24
- package/lib/_object.entries.js +6 -5
- package/lib/_object.values.js +5 -4
- package/lib/_omit.js +12 -12
- package/lib/_parseJson.js +7 -6
- package/lib/_pick.js +14 -0
- package/lib/_queue.js +24 -21
- package/lib/_shallowCopy.js +24 -23
- package/lib/_stringify.js +14 -17
- package/lib/_supportWs.js +5 -5
- package/lib/_trim.js +5 -4
- package/lib/_typeOfList.js +22 -21
- package/lib/_uuids.js +30 -35
- package/lib/amostool.js +15 -63
- package/lib/array2tree.js +9 -10
- package/lib/arrayFilter.js +17 -20
- package/lib/arrayUtils.js +13 -11
- package/lib/browser/Cookie.js +34 -35
- package/lib/browser/indexDB.js +71 -82
- package/lib/browserSupport.js +76 -71
- package/lib/completeUnit.js +7 -4
- package/lib/consts.js +2 -1
- package/lib/dom/canvas2img.js +61 -73
- package/lib/dom/canvasTools.js +9 -14
- package/lib/dom/downloadFile.js +15 -12
- package/lib/dom/eventHelper.js +8 -6
- package/lib/dom/fileBlob.js +14 -14
- package/lib/dom/fileSaveAs.js +54 -61
- package/lib/dom/getFontSize.js +7 -10
- package/lib/dom/minfyImg.js +30 -25
- package/lib/encrypt/_base64.js +32 -25
- package/lib/encrypt/_md5.js +68 -31
- package/lib/encrypt/des.js +426 -363
- package/lib/extra/_common.js +119 -166
- package/lib/extra/filterNull.js +3 -2
- package/lib/extra/find.js +10 -11
- package/lib/extra/index.js +4 -3
- package/lib/extra/memo.js +18 -0
- package/lib/extra/pathToTree.js +48 -42
- package/lib/extra/pwdStrength.js +4 -2
- package/lib/extra/sortBy.js +28 -30
- package/lib/flat.js +15 -0
- package/lib/locationParams.js +94 -99
- package/lib/log.js +20 -26
- package/lib/math/_keyColor.js +154 -0
- package/lib/math/addition.js +9 -7
- package/lib/math/amountCase.js +8 -12
- package/lib/math/coinFormat.js +7 -5
- package/lib/math/colorUtil.js +96 -92
- package/lib/math/dateTime.js +76 -94
- package/lib/math/operations.js +33 -37
- package/lib/math/pwdStrength.js +4 -2
- package/lib/math/randomColor.js +17 -5
- package/lib/math/subtraction.js +10 -9
- package/lib/merged.js +9 -9
- package/lib/objectPath.js +88 -95
- package/lib/parseText.js +8 -7
- package/lib/png/Identicon.js +36 -38
- package/lib/png/pnglib.js +58 -32
- package/lib/png/randomPic.js +9 -12
- package/lib/positionFactory.js +25 -80
- package/lib/pwdPolicy.js +27 -31
- package/lib/qs/_assign.js +7 -5
- package/lib/qs/_merge.js +19 -28
- package/lib/qs/_tools.js +3 -2
- package/lib/qs/formats.js +6 -5
- package/lib/qs/index.js +4 -4
- package/lib/qs/parse.js +55 -50
- package/lib/qs/stringify.js +55 -77
- package/lib/qs/utils.js +69 -88
- package/lib/random.js +5 -4
- package/lib/shallowEqual.js +24 -34
- package/lib/store.js +93 -98
- package/lib/strUtils.js +51 -42
- package/lib/tableFilter.js +178 -169
- package/lib/throttleDebounce.js +18 -22
- package/lib/url/encodeUrl.js +5 -4
- package/lib/url/restfulUrl.js +8 -7
- package/lib/utils.js +169 -223
- package/lib/xss/htmlEncode.js +3 -2
- package/lib/xss/implementEncode.js +36 -37
- package/lib/xss/index.js +4 -3
- package/package.json +9 -8
package/lib/_deepCopy.js
CHANGED
|
@@ -1,37 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
5
|
-
return typeof e
|
|
6
|
-
} : function(e) {
|
|
7
|
-
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
|
|
8
|
-
})(e)
|
|
9
|
-
}
|
|
10
|
-
var _typeOfList = require("./_typeOfList"),
|
|
11
|
-
utils = require("./utils"),
|
|
12
|
-
BUILTIN_OBJECT = _typeOfList.BUILTIN_OBJECT,
|
|
13
|
-
TYPED_ARRAY = _typeOfList.TYPED_ARRAY;
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"), _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")), _typeOfList = require("./_typeOfList"), utils = require("./utils"), BUILTIN_OBJECT = _typeOfList.BUILTIN_OBJECT, TYPED_ARRAY = _typeOfList.TYPED_ARRAY;
|
|
14
4
|
|
|
15
|
-
function eq(e,
|
|
16
|
-
return e ===
|
|
5
|
+
function eq(e, r) {
|
|
6
|
+
return e === r || e != e && r != r;
|
|
17
7
|
}
|
|
18
8
|
|
|
19
9
|
function deepCopy(e) {
|
|
20
|
-
if (null == e || "object" !=
|
|
21
|
-
var t = e
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
t = new f(e.length);
|
|
31
|
-
for (var p = 0, y = e.length; p < y; p++) t[p] = deepCopy(e[p])
|
|
10
|
+
if (null == e || "object" != (0, _typeof2.default)(e)) return e;
|
|
11
|
+
var r = e, t = Object.prototype.toString.call(e);
|
|
12
|
+
if ("[object Array]" === t) {
|
|
13
|
+
r = [];
|
|
14
|
+
for (var o = 0, i = e.length; o < i; o++) r[o] = deepCopy(e[o]);
|
|
15
|
+
} else if (TYPED_ARRAY[t]) {
|
|
16
|
+
var p = e.constructor;
|
|
17
|
+
if (e.constructor.from) r = p.from(e); else {
|
|
18
|
+
r = new p(e.length);
|
|
19
|
+
for (var u = 0, f = e.length; u < f; u++) r[u] = deepCopy(e[u]);
|
|
32
20
|
}
|
|
33
|
-
} else if (!BUILTIN_OBJECT[
|
|
34
|
-
|
|
35
|
-
return t
|
|
21
|
+
} else if (!BUILTIN_OBJECT[t] && !utils.isDom(e)) for (var l in r = {}, e) e.hasOwnProperty(l) && (r[l] = deepCopy(e[l]));
|
|
22
|
+
return r;
|
|
36
23
|
}
|
|
37
|
-
|
|
24
|
+
|
|
25
|
+
module.exports = deepCopy, module.exports.eq = eq;
|
package/lib/_deepEqual.js
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
return (
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
var stringify = require("./_stringify"),
|
|
11
|
-
utils = require("./utils"),
|
|
12
|
-
deepEqual = function(t, i) {
|
|
13
|
-
return !(utils.isEmpty(t) && !utils.isEmpty(i) || !utils.isEmpty(t) && utils.isEmpty(i)) && (_typeof(t) === _typeof(i) && (utils.isString(t) && utils.isString(i) || utils.isNumber(t) && utils.isNumber(i) ? t === i : stringify(t) === stringify(i)))
|
|
14
|
-
};
|
|
15
|
-
module.exports = deepEqual;
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"), _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")), stringify = require("./_stringify"), utils = require("./utils"), deepEqual = function(e, i) {
|
|
4
|
+
return !(utils.isEmpty(e) && !utils.isEmpty(i) || !utils.isEmpty(e) && utils.isEmpty(i)) && ((0,
|
|
5
|
+
_typeof2.default)(e) === (0, _typeof2.default)(i) && (utils.isString(e) && utils.isString(i) || utils.isNumber(e) && utils.isNumber(i) ? e === i : stringify(e) === stringify(i)));
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
module.exports = deepEqual;
|
package/lib/_fastDeepEqual.js
CHANGED
|
@@ -1,48 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return "object" === _typeof(t)
|
|
18
|
-
};
|
|
19
|
-
module.exports = function t(r, e) {
|
|
20
|
-
if (r === e) return !0;
|
|
21
|
-
if (r && e && isObj(r) && isObj(e)) {
|
|
22
|
-
var n, o, i = isArray(r),
|
|
23
|
-
f = isArray(e);
|
|
24
|
-
if (i && f) {
|
|
25
|
-
if ((c = r.length) != e.length) return !1;
|
|
26
|
-
for (n = c; 0 != n--;)
|
|
27
|
-
if (!t(r[n], e[n])) return !1;
|
|
28
|
-
return !0
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"), _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")), isArray = Array.isArray, keyList = Object.keys, hasProp = Object.prototype.hasOwnProperty, isFn = function(e) {
|
|
4
|
+
return "function" == typeof e;
|
|
5
|
+
}, isObj = function(e) {
|
|
6
|
+
return "object" === (0, _typeof2.default)(e);
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
module.exports = function e(r, t) {
|
|
10
|
+
if (r === t) return !0;
|
|
11
|
+
if (r && t && isObj(r) && isObj(t)) {
|
|
12
|
+
var i, n, u, f = isArray(r), a = isArray(t);
|
|
13
|
+
if (f && a) {
|
|
14
|
+
if ((n = r.length) != t.length) return !1;
|
|
15
|
+
for (i = n; 0 != i--; ) if (!e(r[i], t[i])) return !1;
|
|
16
|
+
return !0;
|
|
29
17
|
}
|
|
30
|
-
if (
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
if (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (!hasProp.call(e, p[n])) return !1;
|
|
43
|
-
for (n = c; 0 != n--;)
|
|
44
|
-
if (!t(r[o = p[n]], e[o])) return !1;
|
|
45
|
-
return !0
|
|
18
|
+
if (f != a) return !1;
|
|
19
|
+
var o = r instanceof Date, s = t instanceof Date;
|
|
20
|
+
if (o != s) return !1;
|
|
21
|
+
if (o && s) return r.getTime() == t.getTime();
|
|
22
|
+
var p = r instanceof RegExp, l = t instanceof RegExp;
|
|
23
|
+
if (p != l) return !1;
|
|
24
|
+
if (p && l) return r.toString() == t.toString();
|
|
25
|
+
var y = keyList(r);
|
|
26
|
+
if ((n = y.length) !== keyList(t).length) return !1;
|
|
27
|
+
for (i = n; 0 != i--; ) if (!hasProp.call(t, y[i])) return !1;
|
|
28
|
+
for (i = n; 0 != i--; ) if (!e(r[u = y[i]], t[u])) return !1;
|
|
29
|
+
return !0;
|
|
46
30
|
}
|
|
47
|
-
return r &&
|
|
48
|
-
};
|
|
31
|
+
return r && t && isFn(r) && isFn(t) ? r.name === t.name : r != r && t != t;
|
|
32
|
+
};
|
package/lib/_flashSupport.js
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function checkFlash() {
|
|
4
|
-
var
|
|
5
|
-
t = 0,
|
|
6
|
-
n = null;
|
|
4
|
+
var a = 0, e = 0, t = null;
|
|
7
5
|
if (document.all || document.getElementsByTagName("*")) {
|
|
8
6
|
try {
|
|
9
|
-
(
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
if (t = new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) {
|
|
8
|
+
a = 1;
|
|
9
|
+
var n = t.GetVariable("$version");
|
|
10
|
+
e = parseInt(n.split(" ")[0].split(",")[0]);
|
|
11
|
+
}
|
|
12
|
+
} catch (a) {}
|
|
13
|
+
if (!t && navigator.plugins && navigator.plugins.length > 0 && (t = navigator.plugins["Shockwave Flash"])) {
|
|
12
14
|
a = 1;
|
|
13
|
-
for (var s =
|
|
15
|
+
for (var s = t.description.split(" "), i = 0; i < s.length; i++) isNaN(parseInt(s[i])) || (e = parseInt(s[i]));
|
|
14
16
|
}
|
|
15
17
|
}
|
|
16
18
|
return {
|
|
17
19
|
f: a,
|
|
18
|
-
v:
|
|
19
|
-
}
|
|
20
|
+
v: e
|
|
21
|
+
};
|
|
20
22
|
}
|
|
21
|
-
|
|
23
|
+
|
|
24
|
+
module.exports = checkFlash;
|
package/lib/_forOwn.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function forIn(n, r, o) {
|
|
4
|
-
for (var t in n)
|
|
5
|
-
if (!1 === r.call(o, n[t], t, n)) break
|
|
4
|
+
for (var t in n) if (!1 === r.call(o, n[t], t, n)) break;
|
|
6
5
|
}
|
|
6
|
+
|
|
7
7
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
8
|
+
|
|
9
|
+
module.exports = function(n, r, o) {
|
|
10
|
+
forIn(n, (function(t, a) {
|
|
11
|
+
if (hasOwn.call(n, a)) return r.call(o, n[a], a, n);
|
|
12
|
+
}));
|
|
13
|
+
};
|
package/lib/_funcThrottle.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
2
3
|
module.exports = function(e, t, u, o, c) {
|
|
3
|
-
u = u || null, o = o || 500, c = c || 0, clearTimeout(e.timeoutId), c ? (e._cur = Date.now(),
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
e.call(u, t)
|
|
7
|
-
}, o)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
u = u || null, o = o || 500, c = c || 0, clearTimeout(e.timeoutId), c ? (e._cur = Date.now(),
|
|
5
|
+
e._preExecute || (e._preExecute = e._cur), e._cur - e._preExecute > c ? (e.call(u, t),
|
|
6
|
+
e._preExecute = e._cur) : e.timeoutId = setTimeout((function() {
|
|
7
|
+
e.call(u, t);
|
|
8
|
+
}), o)) : e.timeoutId = setTimeout((function() {
|
|
9
|
+
e.call(u, t);
|
|
10
|
+
}), o);
|
|
11
|
+
}, module.exports.simpleThrottle = function(e, t, u) {
|
|
12
|
+
var o, c = e, l = !0;
|
|
11
13
|
return function() {
|
|
12
|
-
var e = arguments,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
14
|
+
var e = arguments, r = this;
|
|
15
|
+
return l ? (c.apply(r, e), l = !1) : (!0 === u && (clearTimeout(o), o = null), !o && void (o = setTimeout((function() {
|
|
16
|
+
clearTimeout(o), o = null, c.apply(r, e);
|
|
17
|
+
}), t || 500)));
|
|
18
|
+
};
|
|
19
|
+
};
|
package/lib/_isnode.js
CHANGED
package/lib/_list.js
CHANGED
|
@@ -1,88 +1,76 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
5
|
-
return typeof t
|
|
6
|
-
} : function(t) {
|
|
7
|
-
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
|
|
8
|
-
})(t)
|
|
9
|
-
}
|
|
10
|
-
var List = {
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"), _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")), List = {
|
|
11
4
|
ArrayList: function() {
|
|
12
|
-
var
|
|
13
|
-
o = 0;
|
|
5
|
+
var t = new Array, e = 0;
|
|
14
6
|
this.size = function() {
|
|
15
|
-
return
|
|
7
|
+
return e;
|
|
16
8
|
}, this.values = function() {
|
|
17
|
-
return
|
|
9
|
+
return t;
|
|
18
10
|
}, this.isEmpty = function() {
|
|
19
|
-
return
|
|
20
|
-
}, this.iterator = function(
|
|
21
|
-
for (var n = 0; n <
|
|
22
|
-
if (0 ==
|
|
11
|
+
return e <= 0;
|
|
12
|
+
}, this.iterator = function(r) {
|
|
13
|
+
for (var n = 0; n < e; n++) {
|
|
14
|
+
if (0 == r.call(null, t[n], n)) return;
|
|
23
15
|
}
|
|
24
|
-
}, this.get = function(
|
|
25
|
-
if (
|
|
26
|
-
return
|
|
27
|
-
}, this.add = function(
|
|
28
|
-
|
|
16
|
+
}, this.get = function(r) {
|
|
17
|
+
if (r >= e) throw "IndexOutOfBoundsException";
|
|
18
|
+
return t[r];
|
|
19
|
+
}, this.add = function(r) {
|
|
20
|
+
t[e] = r, e++;
|
|
29
21
|
}, this.addAll = function(t) {
|
|
30
|
-
for (var
|
|
31
|
-
}, this.set = function(
|
|
32
|
-
if (
|
|
33
|
-
|
|
22
|
+
for (var e = t.size(), r = 0; r < e; r++) this.add(t.get(r));
|
|
23
|
+
}, this.set = function(r, n) {
|
|
24
|
+
if (r >= e || r < 0) throw "IndexOutOfBoundsException";
|
|
25
|
+
t[r] = n;
|
|
34
26
|
}, this.remove = function(t) {
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
} else
|
|
46
|
-
|
|
47
|
-
if (t == i[r]) return r;
|
|
48
|
-
return -1
|
|
27
|
+
var e = this.indexOf(t);
|
|
28
|
+
e > -1 && this.removeAt(e);
|
|
29
|
+
}, this.removeAt = function(r) {
|
|
30
|
+
if (r >= e || r < 0) throw "argument out of range. index=" + r;
|
|
31
|
+
for (var n = e - 1, i = r; i < n; i++) t[i] = t[i + 1];
|
|
32
|
+
delete t[n], e--;
|
|
33
|
+
}, this.indexOf = function(r) {
|
|
34
|
+
if (null == r) return -1;
|
|
35
|
+
if (List.isObject(r)) {
|
|
36
|
+
for (var n = 0; n < e; n++) if (List.simpleEqual(r, t[n])) return n;
|
|
37
|
+
} else for (var i = 0; i < e; i++) if (r == t[i]) return i;
|
|
38
|
+
return -1;
|
|
49
39
|
}, this.clear = function() {
|
|
50
|
-
|
|
51
|
-
}, this.insert = function(
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
i[t] = n
|
|
40
|
+
t = new Array, e = 0;
|
|
41
|
+
}, this.insert = function(r, n) {
|
|
42
|
+
if (r >= e || r < 0) this.add(n); else {
|
|
43
|
+
for (var i = e - 1; i > r; i--) t[i + 1] = t[i];
|
|
44
|
+
t[r] = n;
|
|
56
45
|
}
|
|
57
|
-
|
|
58
|
-
}, this.updateValue = function(r,
|
|
59
|
-
|
|
60
|
-
if (
|
|
61
|
-
if (
|
|
62
|
-
|
|
46
|
+
e++;
|
|
47
|
+
}, this.updateValue = function(r, n) {
|
|
48
|
+
e <= 0 ? (t[e] = n, e++) : t.forEach((function(i, u) {
|
|
49
|
+
if (i[r] !== n[r]) ; else {
|
|
50
|
+
if (u >= e || u < 0) throw "IndexOutOfBoundsException";
|
|
51
|
+
t[u] = n;
|
|
63
52
|
}
|
|
64
|
-
})
|
|
65
|
-
}
|
|
53
|
+
}));
|
|
54
|
+
};
|
|
66
55
|
},
|
|
67
56
|
parse2string: function(t) {
|
|
68
|
-
return JSON.stringify(t)
|
|
57
|
+
return JSON.stringify(t);
|
|
69
58
|
},
|
|
70
59
|
parse2object: function(str) {
|
|
71
|
-
return eval("(" + str + ")")
|
|
60
|
+
return eval("(" + str + ")");
|
|
72
61
|
},
|
|
73
|
-
simpleEqual: function(t,
|
|
74
|
-
if (t ===
|
|
75
|
-
if ("object" !==
|
|
76
|
-
var r = Object.keys(t),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
if (!i(r[o]) || t[r[o]] !== n[r[o]]) return !1;
|
|
81
|
-
return !0
|
|
62
|
+
simpleEqual: function(t, e) {
|
|
63
|
+
if (t === e) return !0;
|
|
64
|
+
if ("object" !== (0, _typeof2.default)(t) || null === t || "object" !== (0, _typeof2.default)(e) || null === e) return !1;
|
|
65
|
+
var r = Object.keys(t), n = Object.keys(e);
|
|
66
|
+
if (r.length !== n.length) return !1;
|
|
67
|
+
for (var i = hasOwnProperty.bind(e), u = 0; u < r.length; u++) if (!i(r[u]) || t[r[u]] !== e[r[u]]) return !1;
|
|
68
|
+
return !0;
|
|
82
69
|
},
|
|
83
70
|
isObject: function(t) {
|
|
84
|
-
var
|
|
85
|
-
return "function" ===
|
|
71
|
+
var e = (0, _typeof2.default)(t);
|
|
72
|
+
return "function" === e || "object" === e && !!t;
|
|
86
73
|
}
|
|
87
74
|
};
|
|
88
|
-
|
|
75
|
+
|
|
76
|
+
module.exports = List;
|
package/lib/_object.assign.js
CHANGED
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
return (_extends = Object.assign || function(e) {
|
|
5
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
6
|
-
var t = arguments[r];
|
|
7
|
-
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n])
|
|
8
|
-
}
|
|
9
|
-
return e
|
|
10
|
-
}).apply(this, arguments)
|
|
11
|
-
}
|
|
12
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols,
|
|
13
|
-
hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
14
|
-
propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"), _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")), getOwnPropertySymbols = Object.getOwnPropertySymbols, hasOwnProperty = Object.prototype.hasOwnProperty, propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
15
4
|
|
|
16
5
|
function toObject(e) {
|
|
17
6
|
if (null == e) throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
18
|
-
return Object(e)
|
|
7
|
+
return Object(e);
|
|
19
8
|
}
|
|
20
9
|
|
|
21
10
|
function shouldUseNative() {
|
|
@@ -24,24 +13,25 @@ function shouldUseNative() {
|
|
|
24
13
|
var e = new String("abc");
|
|
25
14
|
if (e[5] = "de", "5" === Object.getOwnPropertyNames(e)[0]) return !1;
|
|
26
15
|
for (var r = {}, t = 0; t < 10; t++) r["_" + String.fromCharCode(t)] = t;
|
|
27
|
-
if ("0123456789" !== Object.getOwnPropertyNames(r).map(function(e) {
|
|
28
|
-
|
|
29
|
-
|
|
16
|
+
if ("0123456789" !== Object.getOwnPropertyNames(r).map((function(e) {
|
|
17
|
+
return r[e];
|
|
18
|
+
})).join("")) return !1;
|
|
30
19
|
var n = {};
|
|
31
|
-
return "abcdefghijklmnopqrst".split("").forEach(function(e) {
|
|
32
|
-
n[e] = e
|
|
33
|
-
}), "abcdefghijklmnopqrst" === Object.keys(
|
|
20
|
+
return "abcdefghijklmnopqrst".split("").forEach((function(e) {
|
|
21
|
+
n[e] = e;
|
|
22
|
+
})), "abcdefghijklmnopqrst" === Object.keys((0, _extends2.default)({}, n)).join("");
|
|
34
23
|
} catch (e) {
|
|
35
|
-
return !1
|
|
24
|
+
return !1;
|
|
36
25
|
}
|
|
37
26
|
}
|
|
27
|
+
|
|
38
28
|
module.exports = shouldUseNative() ? Object.assign : function(e, r) {
|
|
39
29
|
for (var t, n, o = toObject(e), a = 1; a < arguments.length; a++) {
|
|
40
|
-
for (var
|
|
30
|
+
for (var i in t = Object(arguments[a])) hasOwnProperty.call(t, i) && (o[i] = t[i]);
|
|
41
31
|
if (getOwnPropertySymbols) {
|
|
42
32
|
n = getOwnPropertySymbols(t);
|
|
43
|
-
for (var
|
|
33
|
+
for (var s = 0; s < n.length; s++) propIsEnumerable.call(t, n[s]) && (o[n[s]] = t[n[s]]);
|
|
44
34
|
}
|
|
45
35
|
}
|
|
46
|
-
return o
|
|
47
|
-
};
|
|
36
|
+
return o;
|
|
37
|
+
};
|
package/lib/_object.entries.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
|
|
3
|
+
var utils = require("./utils"), isEnumerable = Function.bind.call(Function.call, Object.prototype.propertyIsEnumerable);
|
|
4
|
+
|
|
4
5
|
module.exports = Object.entries ? Object.entries : function(e) {
|
|
5
6
|
if (!utils.isObject(e)) return [];
|
|
6
7
|
var t = [];
|
|
7
|
-
for (var r in e) utils.has(e, r) && isEnumerable(e, r) && t.push([r, e[r]]);
|
|
8
|
-
return t
|
|
9
|
-
};
|
|
8
|
+
for (var r in e) utils.has(e, r) && isEnumerable(e, r) && t.push([ r, e[r] ]);
|
|
9
|
+
return t;
|
|
10
|
+
};
|
package/lib/_object.values.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
|
|
3
|
+
var utils = require("./utils"), isEnumerable = Function.bind.call(Function.call, Object.prototype.propertyIsEnumerable);
|
|
4
|
+
|
|
4
5
|
module.exports = Object.values ? Object.values : function(e) {
|
|
5
6
|
if (!utils.isObject(e)) return [];
|
|
6
7
|
var t = [];
|
|
7
8
|
for (var r in e) utils.has(e, r) && isEnumerable(e, r) && t.push(e[r]);
|
|
8
|
-
return t
|
|
9
|
-
};
|
|
9
|
+
return t;
|
|
10
|
+
};
|
package/lib/_omit.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"function" == typeof
|
|
9
|
-
var
|
|
10
|
-
return
|
|
11
|
-
-1
|
|
12
|
-
}),
|
|
13
|
-
};
|
|
2
|
+
|
|
3
|
+
var forOwn = require("./_forOwn"), _utils = require("./utils");
|
|
4
|
+
|
|
5
|
+
module.exports = function(t, n) {
|
|
6
|
+
if (!_utils.isObject(t)) return {};
|
|
7
|
+
var e, r = (n = [].concat.apply([], [].slice.call(arguments, 1)))[n.length - 1], i = {};
|
|
8
|
+
"function" == typeof r && (e = n.pop());
|
|
9
|
+
var o = "function" == typeof e;
|
|
10
|
+
return n.length || o ? (forOwn(t, (function(r, u) {
|
|
11
|
+
-1 === n.indexOf(u) && (o ? e(r, u, t) && (i[u] = r) : i[u] = r);
|
|
12
|
+
})), i) : t;
|
|
13
|
+
};
|
package/lib/_parseJson.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
2
3
|
var trim = require("./_trim");
|
|
4
|
+
|
|
3
5
|
module.exports = function(r) {
|
|
4
6
|
if (window.JSON && window.JSON.parse) return window.JSON.parse(r + "");
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
7
|
+
var n, t = null, e = trim(r + "");
|
|
8
|
+
return e && !trim(e.replace(/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g, (function(r, e, i, u) {
|
|
9
|
+
return n && e && (t = 0), 0 === t ? r : (n = i || e, t += !u - !i, "");
|
|
10
|
+
}))) ? Function("return " + e)() : Function("Invalid JSON: " + r)();
|
|
11
|
+
};
|
package/lib/_pick.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _utils = require("./utils");
|
|
4
|
+
|
|
5
|
+
module.exports = function(r, i) {
|
|
6
|
+
if (!_utils.isObject(r)) return {};
|
|
7
|
+
var t = {};
|
|
8
|
+
if (_utils.isString(i)) return i in r && (t[i] = r[i]), t;
|
|
9
|
+
if (_utils.isArray(i) && i.length > 0) for (var u = 0, e = i.length; u < e; u++) {
|
|
10
|
+
var s = i[u];
|
|
11
|
+
s in r && (t[s] = r[s]);
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|