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.
- package/.prettierignore +2 -2
- package/.prettierrc +50 -50
- package/README.md +3 -0
- package/apis/objectPath.md +129 -129
- package/docs/Logger.html +160 -2
- package/docs/global.html +529 -65
- package/docs/index.html +5 -2
- package/index.d.ts +11 -2
- package/index.js +3 -3
- package/lib/_browser.js +10 -8
- package/lib/_clone.js +68 -57
- package/lib/_cookie.js +50 -47
- package/lib/_deepCopy.js +14 -19
- package/lib/_deepEqual.js +7 -8
- package/lib/_fastDeepEqual.js +26 -34
- 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 +74 -79
- package/lib/_object.assign.js +19 -19
- package/lib/_object.entries.js +8 -7
- package/lib/_object.values.js +8 -7
- package/lib/_omit.js +12 -11
- package/lib/_parseJson.js +7 -6
- package/lib/_pick.js +8 -7
- package/lib/_queue.js +24 -21
- package/lib/_shallowCopy.js +24 -23
- package/lib/_stringify.js +13 -10
- 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 +4 -66
- package/lib/array2tree.js +9 -9
- package/lib/arrayFilter.js +18 -19
- package/lib/arrayUtils.js +10 -8
- package/lib/browser/Cookie.js +35 -36
- package/lib/browser/indexDB.js +72 -71
- package/lib/browserSupport.js +76 -71
- package/lib/completeUnit.js +7 -4
- package/lib/consts.js +2 -1
- package/lib/dom/canvas2img.js +61 -72
- package/lib/dom/canvasTools.js +11 -16
- package/lib/dom/downloadFile.js +17 -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 +27 -24
- package/lib/encrypt/_base64.js +32 -25
- package/lib/encrypt/_md5.js +68 -31
- package/lib/encrypt/des.js +430 -366
- package/lib/extra/_common.js +120 -161
- package/lib/extra/filterNull.js +5 -4
- 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 +49 -36
- package/lib/extra/pwdStrength.js +4 -2
- package/lib/extra/sortBy.js +28 -30
- package/lib/flat.js +9 -13
- package/lib/locationParams.js +93 -95
- package/lib/log.js +23 -26
- package/lib/math/_keyColor.js +3 -1
- package/lib/math/addition.js +9 -7
- package/lib/math/amountCase.js +8 -12
- package/lib/math/coinFormat.js +6 -4
- package/lib/math/colorUtil.js +91 -94
- package/lib/math/dateTime.js +79 -97
- 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 +81 -82
- package/lib/parseText.js +8 -7
- package/lib/png/Identicon.js +32 -28
- package/lib/png/pnglib.js +59 -34
- package/lib/png/randomPic.js +8 -14
- package/lib/positionFactory.js +28 -28
- package/lib/pwdPolicy.js +27 -31
- package/lib/qs/_assign.js +7 -5
- package/lib/qs/_merge.js +20 -23
- 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 +56 -51
- package/lib/qs/stringify.js +54 -69
- package/lib/qs/utils.js +70 -83
- package/lib/random.js +5 -4
- package/lib/shallowEqual.js +25 -29
- package/lib/store.js +93 -95
- package/lib/strUtils.js +52 -43
- 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 +170 -222
- package/lib/xss/htmlEncode.js +3 -2
- package/lib/xss/implementEncode.js +36 -37
- package/lib/xss/index.js +4 -3
- package/package.json +4 -4
package/docs/index.html
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
<nav >
|
|
29
29
|
|
|
30
|
-
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Logger.html">Logger</a></li></ul><h3>Global</h3><ul><li><a href="global.html#_boost">_boost</a></li><li><a href="global.html#_defaultBrowsers">_defaultBrowsers</a></li><li><a href="global.html#_muiltBrowsers">_muiltBrowsers</a></li><li><a href="global.html#_utils">_utils</a></li><li><a href="global.html#advancePolicy">advancePolicy</a></li><li><a href="global.html#amosCookie">amosCookie</a></li><li><a href="global.html#array2tree">array2tree</a></li><li><a href="global.html#arrayFilter">arrayFilter</a></li><li><a href="global.html#beautifyRoutes">beautifyRoutes</a></li><li><a href="global.html#browserSupport">browserSupport</a></li><li><a href="global.html#bt4ToHex">bt4ToHex</a></li><li><a href="global.html#byteToString">byteToString</a></li><li><a href="global.html#calcBrowserVersion">calcBrowserVersion</a></li><li><a href="global.html#checkFlash">checkFlash</a></li><li><a href="global.html#clone">clone</a></li><li><a href="global.html#colorKeyWordsHexStr">colorKeyWordsHexStr</a></li><li><a href="global.html#customEqual">customEqual</a></li><li><a href="global.html#debounce">debounce</a></li><li><a href="global.html#deepCopy">deepCopy</a></li><li><a href="global.html#deepEqual">deepEqual</a></li><li><a href="global.html#DesUtils">DesUtils</a></li><li><a href="global.html#divide">divide</a></li><li><a href="global.html#drawPolygon">drawPolygon</a></li><li><a href="global.html#enc">enc</a></li><li><a href="global.html#encodeLen">encodeLen</a></li><li><a href="global.html#encodeNumber">encodeNumber</a></li><li><a href="global.html#eq">eq</a></li><li><a href="global.html#fieldContentRegExp">fieldContentRegExp</a></li><li><a href="global.html#fileterAllMatchedData">fileterAllMatchedData</a></li><li><a href="global.html#filterAllCheckedData">filterAllCheckedData</a></li><li><a href="global.html#filterChilds">filterChilds</a></li><li><a href="global.html#filterTreeLevel">filterTreeLevel</a></li><li><a href="global.html#genBitmapImage">genBitmapImage</a></li><li><a href="global.html#generateKeys">generateKeys</a></li><li><a href="global.html#getFileExtension">getFileExtension</a></li><li><a href="global.html#getKeyBytes">getKeyBytes</a></li><li><a href="global.html#getTreeFlatKeys">getTreeFlatKeys</a></li><li><a href="global.html#gradientColor">gradientColor</a></li><li><a href="global.html#has">has</a></li><li><a href="global.html#hasOwnProperty">hasOwnProperty</a></li><li><a href="global.html#hexToBt4">hexToBt4</a></li><li><a href="global.html#imageCompress">imageCompress</a></li><li><a href="global.html#isArray">isArray</a></li><li><a href="global.html#isBoolean">isBoolean</a></li><li><a href="global.html#isBuiltInObject">isBuiltInObject</a></li><li><a href="global.html#isDom">isDom</a></li><li><a href="global.html#isElement">isElement</a></li><li><a href="global.html#isEmpty">isEmpty</a></li><li><a href="global.html#isEmptyObject">isEmptyObject</a></li><li><a href="global.html#isFloat">isFloat</a></li><li><a href="global.html#isHexColor">isHexColor</a></li><li><a href="global.html#isImageSrc">isImageSrc</a></li><li><a href="global.html#isJson">isJson</a></li><li><a href="global.html#isKeyColor">isKeyColor</a></li><li><a href="global.html#isKeyInObject">isKeyInObject</a></li><li><a href="global.html#isNil">isNil</a></li><li><a href="global.html#isNull">isNull</a></li><li><a href="global.html#isNumber">isNumber</a></li><li><a href="global.html#isObject">isObject</a></li><li><a href="global.html#isOnlyObject">isOnlyObject</a></li><li><a href="global.html#isOpacity">isOpacity</a></li><li><a href="global.html#isRgbColor">isRgbColor</a></li><li><a href="global.html#isUndefined">isUndefined</a></li><li><a href="global.html#isUrl">isUrl</a></li><li><a href="global.html#isValidDate">isValidDate</a></li><li><a href="global.html#keyColorToHex">keyColorToHex</a></li><li><a href="global.html#Log">Log</a></li><li><a href="global.html#merge">merge</a></li><li><a href="global.html#mergeAll">mergeAll</a></li><li><a href="global.html#mod">mod</a></li><li><a href="global.html#multiply">multiply</a></li><li><a href="global.html#normalPolicy">normalPolicy</a></li><li><a href="global.html#null2default">null2default</a></li><li><a href="global.html#objRGB2str">objRGB2str</a></li><li><a href="global.html#parse">parse</a></li><li><a href="global.html#plus">plus</a></li><li><a href="global.html#PNGlib">PNGlib</a></li><li><a href="global.html#Queue">Queue</a></li><li><a href="global.html#random">random</a></li><li><a href="global.html#randomInt">randomInt</a></li><li><a href="global.html#recursive">recursive</a></li><li><a href="global.html#recursiveGen">recursiveGen</a></li><li><a href="global.html#rgb2object">rgb2object</a></li><li><a href="global.html#saveAsImage">saveAsImage</a></li><li><a href="global.html#serialize">serialize</a></li><li><a href="global.html#shallowEqual">shallowEqual</a></li><li><a href="global.html#simpleEqual">simpleEqual</a></li><li><a href="global.html#simpleThrottle">simpleThrottle</a></li><li><a href="global.html#some">some</a></li><li><a href="global.html#stringIsJson">stringIsJson</a></li><li><a href="global.html#strToBt">strToBt</a></li><li><a href="global.html#subtract">subtract</a></li><li><a href="global.html#throttle">throttle</a></li><li><a href="global.html#toHexColor">toHexColor</a></li><li><a href="global.html#toRGBcolor">toRGBcolor</a></li><li><a href="global.html#toStringHexColor">toStringHexColor</a></li><li><a href="global.html#transformColor">transformColor</a></li><li><a href="global.html#useMd5Policy">useMd5Policy</a></li><li><a href="global.html#useMd5Policy2">useMd5Policy2</a></li><li><a href="global.html#utils">utils</a></li><li><a href="global.html#values">values</a></li></ul>
|
|
30
|
+
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Logger.html">Logger</a><ul class='methods'><li data-type='method'><a href="Logger.html#pkgInfo">pkgInfo</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#_boost">_boost</a></li><li><a href="global.html#_defaultBrowsers">_defaultBrowsers</a></li><li><a href="global.html#_muiltBrowsers">_muiltBrowsers</a></li><li><a href="global.html#_utils">_utils</a></li><li><a href="global.html#advancePolicy">advancePolicy</a></li><li><a href="global.html#amosCookie">amosCookie</a></li><li><a href="global.html#array2tree">array2tree</a></li><li><a href="global.html#arrayFilter">arrayFilter</a></li><li><a href="global.html#beautifyRoutes">beautifyRoutes</a></li><li><a href="global.html#browserSupport">browserSupport</a></li><li><a href="global.html#bt4ToHex">bt4ToHex</a></li><li><a href="global.html#byteToString">byteToString</a></li><li><a href="global.html#calcBrowserVersion">calcBrowserVersion</a></li><li><a href="global.html#checkFlash">checkFlash</a></li><li><a href="global.html#clone">clone</a></li><li><a href="global.html#colorKeyWordsHexStr">colorKeyWordsHexStr</a></li><li><a href="global.html#customEqual">customEqual</a></li><li><a href="global.html#debounce">debounce</a></li><li><a href="global.html#deepCopy">deepCopy</a></li><li><a href="global.html#deepEqual">deepEqual</a></li><li><a href="global.html#DesUtils">DesUtils</a></li><li><a href="global.html#divide">divide</a></li><li><a href="global.html#drawPolygon">drawPolygon</a></li><li><a href="global.html#enc">enc</a></li><li><a href="global.html#encodeLen">encodeLen</a></li><li><a href="global.html#encodeNumber">encodeNumber</a></li><li><a href="global.html#eq">eq</a></li><li><a href="global.html#fieldContentRegExp">fieldContentRegExp</a></li><li><a href="global.html#fileterAllMatchedData">fileterAllMatchedData</a></li><li><a href="global.html#filterAllCheckedData">filterAllCheckedData</a></li><li><a href="global.html#filterChilds">filterChilds</a></li><li><a href="global.html#filterTreeLevel">filterTreeLevel</a></li><li><a href="global.html#genBitmapImage">genBitmapImage</a></li><li><a href="global.html#generateKeys">generateKeys</a></li><li><a href="global.html#getFileExtension">getFileExtension</a></li><li><a href="global.html#getKeyBytes">getKeyBytes</a></li><li><a href="global.html#getTreeFlatKeys">getTreeFlatKeys</a></li><li><a href="global.html#gradientColor">gradientColor</a></li><li><a href="global.html#has">has</a></li><li><a href="global.html#hasOwnProperty">hasOwnProperty</a></li><li><a href="global.html#hexToBt4">hexToBt4</a></li><li><a href="global.html#imageCompress">imageCompress</a></li><li><a href="global.html#isArray">isArray</a></li><li><a href="global.html#isBoolean">isBoolean</a></li><li><a href="global.html#isBuiltInObject">isBuiltInObject</a></li><li><a href="global.html#isDom">isDom</a></li><li><a href="global.html#isElement">isElement</a></li><li><a href="global.html#isEmpty">isEmpty</a></li><li><a href="global.html#isEmptyObject">isEmptyObject</a></li><li><a href="global.html#isFloat">isFloat</a></li><li><a href="global.html#isHexColor">isHexColor</a></li><li><a href="global.html#isImageSrc">isImageSrc</a></li><li><a href="global.html#isInputEqual">isInputEqual</a></li><li><a href="global.html#isJson">isJson</a></li><li><a href="global.html#isKeyColor">isKeyColor</a></li><li><a href="global.html#isKeyInObject">isKeyInObject</a></li><li><a href="global.html#isNil">isNil</a></li><li><a href="global.html#isNull">isNull</a></li><li><a href="global.html#isNumber">isNumber</a></li><li><a href="global.html#isObject">isObject</a></li><li><a href="global.html#isOnlyObject">isOnlyObject</a></li><li><a href="global.html#isOpacity">isOpacity</a></li><li><a href="global.html#isRgbColor">isRgbColor</a></li><li><a href="global.html#isUndefined">isUndefined</a></li><li><a href="global.html#isUrl">isUrl</a></li><li><a href="global.html#isValidDate">isValidDate</a></li><li><a href="global.html#keyColorToHex">keyColorToHex</a></li><li><a href="global.html#Log">Log</a></li><li><a href="global.html#merge">merge</a></li><li><a href="global.html#mergeAll">mergeAll</a></li><li><a href="global.html#mod">mod</a></li><li><a href="global.html#multiply">multiply</a></li><li><a href="global.html#normalPolicy">normalPolicy</a></li><li><a href="global.html#null2default">null2default</a></li><li><a href="global.html#objRGB2str">objRGB2str</a></li><li><a href="global.html#parse">parse</a></li><li><a href="global.html#pathToTree">pathToTree</a></li><li><a href="global.html#plus">plus</a></li><li><a href="global.html#PNGlib">PNGlib</a></li><li><a href="global.html#Queue">Queue</a></li><li><a href="global.html#random">random</a></li><li><a href="global.html#randomInt">randomInt</a></li><li><a href="global.html#recursive">recursive</a></li><li><a href="global.html#recursiveGen">recursiveGen</a></li><li><a href="global.html#rgb2object">rgb2object</a></li><li><a href="global.html#saveAsImage">saveAsImage</a></li><li><a href="global.html#serialize">serialize</a></li><li><a href="global.html#shallowEqual">shallowEqual</a></li><li><a href="global.html#simpleEqual">simpleEqual</a></li><li><a href="global.html#simpleThrottle">simpleThrottle</a></li><li><a href="global.html#some">some</a></li><li><a href="global.html#stringIsJson">stringIsJson</a></li><li><a href="global.html#strToBt">strToBt</a></li><li><a href="global.html#subObjectEqual">subObjectEqual</a></li><li><a href="global.html#subtract">subtract</a></li><li><a href="global.html#throttle">throttle</a></li><li><a href="global.html#toHexColor">toHexColor</a></li><li><a href="global.html#toRGBcolor">toRGBcolor</a></li><li><a href="global.html#toStringHexColor">toStringHexColor</a></li><li><a href="global.html#transformColor">transformColor</a></li><li><a href="global.html#useMd5Policy">useMd5Policy</a></li><li><a href="global.html#useMd5Policy2">useMd5Policy2</a></li><li><a href="global.html#utils">utils</a></li><li><a href="global.html#values">values</a></li></ul>
|
|
31
31
|
</nav>
|
|
32
32
|
|
|
33
33
|
<div id="main">
|
|
@@ -396,6 +396,9 @@ const result2 = browserSupport(paramsList, limit);
|
|
|
396
396
|
Log.error()
|
|
397
397
|
Log.fatal()
|
|
398
398
|
|
|
399
|
+
// 展示 pkg 信息,不受 LogConfig 配置影响
|
|
400
|
+
Log.pkgInfo(name, version)
|
|
401
|
+
|
|
399
402
|
</code></pre>
|
|
400
403
|
<h3>store</h3>
|
|
401
404
|
<pre class="prettyprint source lang-js"><code>`default function list`
|
|
@@ -778,7 +781,7 @@ convert2BMP(canvas, width, height)</p>
|
|
|
778
781
|
<br class="clear">
|
|
779
782
|
|
|
780
783
|
<footer>
|
|
781
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on
|
|
784
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on Wed Apr 27 2022 17:25:38 GMT+0800 (GMT+08:00) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
782
785
|
</footer>
|
|
783
786
|
|
|
784
787
|
<script>prettyPrint();</script>
|
package/index.d.ts
CHANGED
|
@@ -169,11 +169,14 @@ declare namespace LocationParam {
|
|
|
169
169
|
export function parse(paramString: string): object;
|
|
170
170
|
export function paramSearch(_name: string, target: string): void;
|
|
171
171
|
/**
|
|
172
|
-
* 获取 location 中的所有参数
|
|
172
|
+
* - 获取 location 中的所有参数
|
|
173
|
+
* - 对 location.href 进行查找,支持 hash 方式的路由
|
|
173
174
|
*/
|
|
174
175
|
export function getLocationParams(): object;
|
|
175
176
|
/**
|
|
176
|
-
* 获取 location
|
|
177
|
+
* - 获取 location 中的参数。
|
|
178
|
+
* - 采用 location.search 进行查找,因此,如果采用 react-router hash 方式,将无法获取到参数
|
|
179
|
+
* - why not support hash router? because in hash router location.search=''
|
|
177
180
|
* @param name
|
|
178
181
|
*/
|
|
179
182
|
export function getLocationParamByName(name: string): string | null;
|
|
@@ -986,6 +989,12 @@ declare namespace utils {
|
|
|
986
989
|
* @return target
|
|
987
990
|
*/
|
|
988
991
|
export function mergeAll(targetAndSources: Array<any>, overwrite?: boolean): object | Array<any>;
|
|
992
|
+
/**
|
|
993
|
+
* 比较 objTarget 中的所有属性值,是否在 objSource 中相等
|
|
994
|
+
* @param objSource
|
|
995
|
+
* @param objTarget
|
|
996
|
+
*/
|
|
997
|
+
export function subObjectEqual(objSource: {}, objTarget: {}): Boolean;
|
|
989
998
|
}
|
|
990
999
|
|
|
991
1000
|
declare namespace throttleDebounce {
|
package/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var amostool = require('./lib/amostool');
|
|
2
|
-
|
|
3
|
-
module.exports = amostool;
|
|
1
|
+
var amostool = require('./lib/amostool');
|
|
2
|
+
|
|
3
|
+
module.exports = amostool;
|
package/lib/_browser.js
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
2
3
|
var Browser = {
|
|
3
4
|
isFirefox: function() {
|
|
4
|
-
return "undefined" != typeof InstallTrigger
|
|
5
|
+
return "undefined" != typeof InstallTrigger;
|
|
5
6
|
},
|
|
6
7
|
isIE: function() {
|
|
7
|
-
return !!document.documentMode
|
|
8
|
+
return !!document.documentMode;
|
|
8
9
|
},
|
|
9
10
|
isEdge: function() {
|
|
10
|
-
return !Browser.isIE() && !!window.StyleMedia
|
|
11
|
+
return !Browser.isIE() && !!window.StyleMedia;
|
|
11
12
|
},
|
|
12
13
|
isChrome: function() {
|
|
13
|
-
return !!window.chrome && !!window.chrome.webstore
|
|
14
|
+
return !!window.chrome && !!window.chrome.webstore;
|
|
14
15
|
},
|
|
15
16
|
isSafari: function() {
|
|
16
|
-
return
|
|
17
|
+
return Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor") > 0 || -1 !== navigator.userAgent.toLowerCase().indexOf("safari");
|
|
17
18
|
},
|
|
18
19
|
wp: function() {
|
|
19
|
-
navigator.userAgent.match(/Windows Phone ([\d.]+)/)
|
|
20
|
+
navigator.userAgent.match(/Windows Phone ([\d.]+)/);
|
|
20
21
|
},
|
|
21
22
|
android: function() {
|
|
22
|
-
navigator.userAgent.match(/(Android);?[\s\/]+([\d.]+)?/)
|
|
23
|
+
navigator.userAgent.match(/(Android);?[\s\/]+([\d.]+)?/);
|
|
23
24
|
}
|
|
24
25
|
};
|
|
25
|
-
|
|
26
|
+
|
|
27
|
+
module.exports = Browser;
|
package/lib/_clone.js
CHANGED
|
@@ -1,68 +1,79 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"), _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")), findType = function(e) {
|
|
4
|
+
return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1];
|
|
5
|
+
};
|
|
7
6
|
|
|
8
7
|
function findAllType(e) {
|
|
9
8
|
switch (Object.prototype.toString.call(e)) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
case "[object Date]":
|
|
10
|
+
return "date";
|
|
11
|
+
|
|
12
|
+
case "[object RegExp]":
|
|
13
|
+
return "regexp";
|
|
14
|
+
|
|
15
|
+
case "[object Arguments]":
|
|
16
|
+
return "arguments";
|
|
17
|
+
|
|
18
|
+
case "[object Array]":
|
|
19
|
+
return "array";
|
|
20
|
+
|
|
21
|
+
case "[object Error]":
|
|
22
|
+
return "error";
|
|
20
23
|
}
|
|
21
|
-
return null === e ? "null" : void 0 === e ? "undefined" : e && 1 === e.nodeType ? "element" : (e = e.valueOf ? e.valueOf() : Object.prototype.valueOf.apply(e),
|
|
24
|
+
return null === e ? "null" : void 0 === e ? "undefined" : e && 1 === e.nodeType ? "element" : (e = e.valueOf ? e.valueOf() : Object.prototype.valueOf.apply(e),
|
|
25
|
+
(0, _typeof2.default)(e));
|
|
22
26
|
}
|
|
27
|
+
|
|
23
28
|
var simpleClone = function e(r) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
29
|
+
switch (findType(r)) {
|
|
30
|
+
case "Object":
|
|
31
|
+
var t = {};
|
|
32
|
+
for (var n in r) r.hasOwnProperty(n) && (t[n] = e(r[n]));
|
|
33
|
+
return t;
|
|
34
|
+
|
|
35
|
+
case "Array":
|
|
36
|
+
return r.slice();
|
|
37
|
+
}
|
|
38
|
+
return r;
|
|
39
|
+
}, clone = function(e) {
|
|
40
|
+
try {
|
|
41
|
+
return JSON.parse(JSON.stringify(e, (function(e, r) {
|
|
42
|
+
return "function" == typeof r ? r.toString() : r;
|
|
43
|
+
})));
|
|
44
|
+
} catch (r) {
|
|
45
|
+
return e;
|
|
46
|
+
}
|
|
47
|
+
}, cloneAll = function e(r) {
|
|
48
|
+
switch (findAllType(r)) {
|
|
49
|
+
case "object":
|
|
50
|
+
var t = {};
|
|
51
|
+
return Object.keys(r).forEach((function(n) {
|
|
52
|
+
"$" !== n.charAt(0) && (t[n] = e(r[n]));
|
|
53
|
+
})), t;
|
|
54
|
+
|
|
55
|
+
case "element":
|
|
56
|
+
return r.cloneNode(!0);
|
|
57
|
+
|
|
58
|
+
case "array":
|
|
59
|
+
for (var n = new Array(r.length), o = 0, l = r.length; o < l; o++) n[o] = e(r[o]);
|
|
60
|
+
return n;
|
|
61
|
+
|
|
62
|
+
case "regexp":
|
|
63
|
+
var a = "";
|
|
64
|
+
return a += r.multiline ? "m" : "", a += r.global ? "g" : "", a += r.ignoreCase ? "i" : "",
|
|
65
|
+
new RegExp(r.source, a);
|
|
66
|
+
|
|
67
|
+
case "date":
|
|
68
|
+
return new Date(r.getTime());
|
|
69
|
+
|
|
70
|
+
default:
|
|
71
|
+
return r;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
64
75
|
module.exports = {
|
|
65
76
|
simpleClone: simpleClone,
|
|
66
77
|
clone: clone,
|
|
67
78
|
cloneAll: cloneAll
|
|
68
|
-
};
|
|
79
|
+
};
|
package/lib/_cookie.js
CHANGED
|
@@ -1,68 +1,71 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
pairSplitRegExp = /; */,
|
|
5
|
-
fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
|
2
|
+
|
|
3
|
+
var decode = decodeURIComponent, encode = encodeURIComponent, pairSplitRegExp = /; */, fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
|
6
4
|
|
|
7
5
|
function parse(e, t) {
|
|
8
6
|
if ("string" != typeof e) throw new TypeError("argument str must be a string");
|
|
9
|
-
for (var
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
for (var r = {}, i = t || {}, n = e.split(pairSplitRegExp), o = i.decode || decode, a = 0; a < n.length; a++) {
|
|
8
|
+
var s = n[a], p = s.indexOf("=");
|
|
9
|
+
if (!(p < 0)) {
|
|
10
|
+
var d = s.substr(0, p).trim(), f = s.substr(++p, s.length).trim();
|
|
11
|
+
'"' == f[0] && (f = f.slice(1, -1)), null == r[d] && (r[d] = tryDecode(f, o));
|
|
12
|
+
}
|
|
13
13
|
}
|
|
14
|
-
return
|
|
14
|
+
return r;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
function serialize(e, t,
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
if ("function" != typeof i) throw new TypeError("option encode is invalid");
|
|
17
|
+
function serialize(e, t, r) {
|
|
18
|
+
var i = r || {}, n = i.encode || encode;
|
|
19
|
+
if ("function" != typeof n) throw new TypeError("option encode is invalid");
|
|
21
20
|
if (!fieldContentRegExp.test(e)) throw new TypeError("argument name is invalid");
|
|
22
|
-
|
|
23
|
-
if (
|
|
24
|
-
var
|
|
25
|
-
if (null !=
|
|
26
|
-
|
|
27
|
-
if (isNaN(
|
|
28
|
-
|
|
21
|
+
var o = n(t);
|
|
22
|
+
if (o && !fieldContentRegExp.test(o)) throw new TypeError("argument val is invalid");
|
|
23
|
+
var a = e + "=" + o;
|
|
24
|
+
if (null != i.maxAge) {
|
|
25
|
+
var s = i.maxAge - 0;
|
|
26
|
+
if (isNaN(s)) throw new Error("maxAge should be a Number");
|
|
27
|
+
a += "; Max-Age=" + Math.floor(s);
|
|
29
28
|
}
|
|
30
|
-
if (
|
|
31
|
-
if (!fieldContentRegExp.test(
|
|
32
|
-
|
|
29
|
+
if (i.domain) {
|
|
30
|
+
if (!fieldContentRegExp.test(i.domain)) throw new TypeError("option domain is invalid");
|
|
31
|
+
a += "; Domain=" + i.domain;
|
|
33
32
|
}
|
|
34
|
-
if (
|
|
35
|
-
if (!fieldContentRegExp.test(
|
|
36
|
-
|
|
33
|
+
if (i.path) {
|
|
34
|
+
if (!fieldContentRegExp.test(i.path)) throw new TypeError("option path is invalid");
|
|
35
|
+
a += "; Path=" + i.path;
|
|
37
36
|
}
|
|
38
|
-
if (
|
|
39
|
-
if ("function" != typeof
|
|
40
|
-
|
|
37
|
+
if (i.expires) {
|
|
38
|
+
if ("function" != typeof i.expires.toUTCString) throw new TypeError("option expires is invalid");
|
|
39
|
+
a += "; Expires=" + i.expires.toUTCString();
|
|
41
40
|
}
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
41
|
+
if (i.httpOnly && (a += "; HttpOnly"), i.secure && (a += "; Secure"), i.sameSite) switch ("string" == typeof i.sameSite ? i.sameSite.toLowerCase() : i.sameSite) {
|
|
42
|
+
case !0:
|
|
43
|
+
a += "; SameSite=Strict";
|
|
44
|
+
break;
|
|
45
|
+
|
|
46
|
+
case "lax":
|
|
47
|
+
a += "; SameSite=Lax";
|
|
48
|
+
break;
|
|
49
|
+
|
|
50
|
+
case "strict":
|
|
51
|
+
a += "; SameSite=Strict";
|
|
52
|
+
break;
|
|
53
|
+
|
|
54
|
+
default:
|
|
55
|
+
throw new TypeError("option sameSite is invalid");
|
|
54
56
|
}
|
|
55
|
-
return
|
|
57
|
+
return a;
|
|
56
58
|
}
|
|
57
59
|
|
|
58
|
-
function tryDecode(
|
|
60
|
+
function tryDecode(e, t) {
|
|
59
61
|
try {
|
|
60
|
-
return e
|
|
61
|
-
} catch (
|
|
62
|
-
return
|
|
62
|
+
return t(e);
|
|
63
|
+
} catch (t) {
|
|
64
|
+
return e;
|
|
63
65
|
}
|
|
64
66
|
}
|
|
67
|
+
|
|
65
68
|
module.exports = {
|
|
66
69
|
parse: parse,
|
|
67
70
|
serialize: serialize
|
|
68
|
-
};
|
|
71
|
+
};
|
package/lib/_deepCopy.js
CHANGED
|
@@ -1,30 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
_typeOfList = require("./_typeOfList"),
|
|
5
|
-
utils = require("./utils"),
|
|
6
|
-
BUILTIN_OBJECT = _typeOfList.BUILTIN_OBJECT,
|
|
7
|
-
TYPED_ARRAY = _typeOfList.TYPED_ARRAY;
|
|
2
|
+
|
|
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;
|
|
8
4
|
|
|
9
5
|
function eq(e, r) {
|
|
10
|
-
return e === r || e != e && r != r
|
|
6
|
+
return e === r || e != e && r != r;
|
|
11
7
|
}
|
|
12
8
|
|
|
13
9
|
function deepCopy(e) {
|
|
14
10
|
if (null == e || "object" != (0, _typeof2.default)(e)) return e;
|
|
15
|
-
var r = e,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
for (var
|
|
19
|
-
else if (TYPED_ARRAY[t]) {
|
|
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]) {
|
|
20
16
|
var p = e.constructor;
|
|
21
|
-
if (e.constructor.from) r = p.from(e);
|
|
22
|
-
else {
|
|
17
|
+
if (e.constructor.from) r = p.from(e); else {
|
|
23
18
|
r = new p(e.length);
|
|
24
|
-
for (var u = 0, f = e.length; u < f; u++) r[u] = deepCopy(e[u])
|
|
19
|
+
for (var u = 0, f = e.length; u < f; u++) r[u] = deepCopy(e[u]);
|
|
25
20
|
}
|
|
26
|
-
} else if (!BUILTIN_OBJECT[t] && !utils.isDom(e))
|
|
27
|
-
|
|
28
|
-
return r
|
|
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;
|
|
29
23
|
}
|
|
30
|
-
|
|
24
|
+
|
|
25
|
+
module.exports = deepCopy, module.exports.eq = eq;
|
package/lib/_deepEqual.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
utils
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
module.exports = deepEqual;
|
|
2
|
+
|
|
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 : utils.isArray(e) && utils.isArray(i) ? e.length === i.length : stringify(e) === stringify(i)));
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
module.exports = deepEqual;
|
package/lib/_fastDeepEqual.js
CHANGED
|
@@ -1,40 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
isObj = function(e) {
|
|
11
|
-
return "object" === (0, _typeof2.default)(e)
|
|
12
|
-
};
|
|
2
|
+
|
|
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
|
+
|
|
13
9
|
module.exports = function e(r, t) {
|
|
14
10
|
if (r === t) return !0;
|
|
15
11
|
if (r && t && isObj(r) && isObj(t)) {
|
|
16
|
-
var i, n, u = isArray(r),
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (!e(r[i], t[i])) return !1;
|
|
22
|
-
return !0
|
|
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;
|
|
23
17
|
}
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
if (
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
if (
|
|
30
|
-
if (
|
|
31
|
-
var
|
|
32
|
-
if ((
|
|
33
|
-
for (i =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (!e(r[n = a[i]], t[n])) return !1;
|
|
37
|
-
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;
|
|
38
30
|
}
|
|
39
|
-
return r && t && isFn(r) && isFn(t) ? r.name === t.name : r != r && t != t
|
|
40
|
-
};
|
|
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