amos-tool 1.6.1 → 1.6.2
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/docs/Logger.html +1 -1
- package/docs/global.html +1 -1
- package/docs/index.html +1 -1
- package/index.d.ts +7 -0
- package/lib/locationParams.js +6 -1
- package/lib/utils.js +1 -1
- package/package.json +1 -1
package/docs/Logger.html
CHANGED
|
@@ -336,7 +336,7 @@ isDebug: true
|
|
|
336
336
|
<br class="clear">
|
|
337
337
|
|
|
338
338
|
<footer>
|
|
339
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on
|
|
339
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on Thu Aug 31 2023 11:02:25 GMT+0800 (GMT+08:00) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
340
340
|
</footer>
|
|
341
341
|
|
|
342
342
|
<script>prettyPrint();</script>
|
package/docs/global.html
CHANGED
|
@@ -16607,7 +16607,7 @@ schedule <code>callback</code> to execute after <code>delay</code> ms.</p></td>
|
|
|
16607
16607
|
<br class="clear">
|
|
16608
16608
|
|
|
16609
16609
|
<footer>
|
|
16610
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on
|
|
16610
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on Thu Aug 31 2023 11:02:25 GMT+0800 (GMT+08:00) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
16611
16611
|
</footer>
|
|
16612
16612
|
|
|
16613
16613
|
<script>prettyPrint();</script>
|
package/docs/index.html
CHANGED
|
@@ -789,7 +789,7 @@ convert2BMP(canvas, width, height)</p>
|
|
|
789
789
|
<br class="clear">
|
|
790
790
|
|
|
791
791
|
<footer>
|
|
792
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on
|
|
792
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on Thu Aug 31 2023 11:02:25 GMT+0800 (GMT+08:00) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
793
793
|
</footer>
|
|
794
794
|
|
|
795
795
|
<script>prettyPrint();</script>
|
package/index.d.ts
CHANGED
|
@@ -203,7 +203,13 @@ declare namespace LocationParam {
|
|
|
203
203
|
* - 获取 location 中的参数。
|
|
204
204
|
* - 采用 location.search 进行查找,因此,如果采用 react-router hash 方式,将无法获取到参数
|
|
205
205
|
* - why not support hash router? because in hash router location.search=''
|
|
206
|
+
* - since v1.6.2 add hash supported
|
|
206
207
|
* @param name
|
|
208
|
+
* @example
|
|
209
|
+
* // href='http://113.142.68.105:8090/#/?_k=jxwq5h&token=3355&id=666'
|
|
210
|
+
* getLocationParamByName('token'); // 3355
|
|
211
|
+
* // href='http://113.142.68.105:8090?mmm=jxwq5h&token=3355&id=666'
|
|
212
|
+
* getLocationParamByName('token'); // 3355
|
|
207
213
|
*/
|
|
208
214
|
export function getLocationParamByName(name: string): string | null;
|
|
209
215
|
/**
|
|
@@ -1035,6 +1041,7 @@ declare namespace utils {
|
|
|
1035
1041
|
* isUrl('172.16.1.2') // false
|
|
1036
1042
|
* isUrl('/a/b/c') // false
|
|
1037
1043
|
* isUrl('main/dd/d') // false
|
|
1044
|
+
* isUrl('http://localhost:8080/aaa') // true
|
|
1038
1045
|
*/
|
|
1039
1046
|
export function isUrl(value: string): boolean;
|
|
1040
1047
|
export function isBuiltInObject(value: any): boolean;
|
package/lib/locationParams.js
CHANGED
|
@@ -79,7 +79,12 @@ var utils = require("./utils"), _LSFN = function() {
|
|
|
79
79
|
},
|
|
80
80
|
getLocationParamByName: function(t) {
|
|
81
81
|
var n = new RegExp("(^|&?)".concat(t, "=([^&]*)(&|$)")), i = window.location.search.substr(1).match(n);
|
|
82
|
-
|
|
82
|
+
if (null != i) return decodeURIComponent(i[2]);
|
|
83
|
+
if (!utils.isEmpty(window.location.hash)) {
|
|
84
|
+
var e = window.location.hash.substr(1).match(n);
|
|
85
|
+
if (null != e) return decodeURIComponent(e[2]);
|
|
86
|
+
}
|
|
87
|
+
return null;
|
|
83
88
|
},
|
|
84
89
|
getParameter: function(t, n) {
|
|
85
90
|
var i = new RegExp("(\\?|#|&)" + n + "=([^&#]*)(&|#|$)"), e = t.match(i);
|
package/lib/utils.js
CHANGED
|
@@ -80,7 +80,7 @@ function isDom(e) {
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
function isUrl(e) {
|
|
83
|
-
return isString(e) && (/^https?:\/\/(?!\-)(?:(([0-9]{1,3}\.){3}[0-9]{1,3}))(:[0-9]{1,4}\/)?/.test(e) || /^https?:\/\/(?!\-)(?:[a-zA-Z\d\-]{0,62}[a-zA-Z\d]\.){1,126}(?!\d+)[a-zA-Z\d]{1,63}/.test(e));
|
|
83
|
+
return isString(e) && (/^https?:\/\/(?!\-)(?:(([0-9]{1,3}\.){3}[0-9]{1,3}))(:[0-9]{1,4}\/)?/.test(e) || /^https?:\/\/(?!\-)(?:[a-zA-Z\d\-]{0,62}[a-zA-Z\d]\.){1,126}(?!\d+)[a-zA-Z\d]{1,63}/.test(e) || /^https?:\/\/localhost.*/.test(e));
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
function isBuiltInObject(e) {
|