amos-tool 1.4.15 → 1.4.16

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 CHANGED
@@ -334,7 +334,7 @@ isDebug: true
334
334
  <br class="clear">
335
335
 
336
336
  <footer>
337
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on Wed Sep 07 2022 14:22:01 GMT+0800 (GMT+08:00) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
337
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on Wed Oct 26 2022 16:12:28 GMT+0800 (GMT+08:00) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
338
338
  </footer>
339
339
 
340
340
  <script>prettyPrint();</script>
package/docs/global.html CHANGED
@@ -13754,7 +13754,7 @@ some 为数组中的每一个元素执行一次 callback 函数,直到找到
13754
13754
 
13755
13755
 
13756
13756
 
13757
- <h4 class="name" id="stringIsJson"><span class="type-signature"></span>stringIsJson<span class="signature">(str)</span><span class="type-signature"></span></h4>
13757
+ <h4 class="name" id="stringIsJson"><span class="type-signature"></span>stringIsJson<span class="signature">(str)</span><span class="type-signature"> &rarr; {Boolean}</span></h4>
13758
13758
 
13759
13759
 
13760
13760
 
@@ -13881,11 +13881,19 @@ some 为数组中的每一个元素执行一次 callback 函数,直到找到
13881
13881
  <h5>Returns:</h5>
13882
13882
 
13883
13883
 
13884
- <div class="param-desc">
13885
- <p>boolean</p>
13886
- </div>
13887
13884
 
13888
13885
 
13886
+ <dl class="param-type">
13887
+ <dt>
13888
+ Type
13889
+ </dt>
13890
+ <dd>
13891
+
13892
+ <span class="param-type">Boolean</span>
13893
+
13894
+
13895
+ </dd>
13896
+ </dl>
13889
13897
 
13890
13898
 
13891
13899
 
@@ -15713,7 +15721,7 @@ schedule <code>callback</code> to execute after <code>delay</code> ms.</p></td>
15713
15721
  <br class="clear">
15714
15722
 
15715
15723
  <footer>
15716
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on Wed Sep 07 2022 14:22:01 GMT+0800 (GMT+08:00) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
15724
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on Wed Oct 26 2022 16:12:28 GMT+0800 (GMT+08:00) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
15717
15725
  </footer>
15718
15726
 
15719
15727
  <script>prettyPrint();</script>
package/docs/index.html CHANGED
@@ -783,7 +783,7 @@ convert2BMP(canvas, width, height)</p>
783
783
  <br class="clear">
784
784
 
785
785
  <footer>
786
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on Wed Sep 07 2022 14:22:01 GMT+0800 (GMT+08:00) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
786
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on Wed Oct 26 2022 16:12:28 GMT+0800 (GMT+08:00) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
787
787
  </footer>
788
788
 
789
789
  <script>prettyPrint();</script>
package/index.d.ts CHANGED
@@ -133,12 +133,38 @@ declare namespace UUID {
133
133
  *
134
134
  * @param len uuid 的字符长度
135
135
  * @param radix 位数,默认为 62
136
+ * @example
137
+ * UUID.uuid(); // 7ED03492-919F-40D0-89D2-C53194F4A83D
136
138
  */
137
139
  export function uuid(len: number, radix: number): string;
140
+ /**
141
+ * @example
142
+ * UUID.uuidFast(); // E581CCDD-189C-482D-BE21-620863F423F9
143
+ */
138
144
  export function uuidFast(): string;
145
+ /**
146
+ * @example
147
+ * UUID.uuidCompact(); // 090c3e83-ea67-45c4-b7dc-47c20eaea91e
148
+ */
139
149
  export function uuidCompact(): string;
150
+ /**
151
+ * @param prefix
152
+ * @example
153
+ * UUID.timeUUID(); // amos-timeuuid-1663831567208-1
154
+ */
140
155
  export function timeUUID(prefix: string): string;
156
+ /**
157
+ * @param prefix
158
+ * @example
159
+ * UUID.longTimeUUID(); // longtime-202209221526-1
160
+ */
141
161
  export function longTimeUUID(prefix: string): string;
162
+ /**
163
+ *
164
+ * @param tpl
165
+ * @example
166
+ * UUID.otherUUID(); // 6afe5aaf614eb8b00bf4bcd11a
167
+ */
142
168
  export function otherUUID(tpl: string): string;
143
169
  }
144
170
 
package/lib/utils.js CHANGED
@@ -85,12 +85,23 @@ var null2default = function(e) {
85
85
  return isNull(e) || isUndefined(e) ? "" : e;
86
86
  }, isJson = function(e) {
87
87
  return "object" === (0, _typeof2.default)(e) && "[object object]" === toString.call(e).toLowerCase() && !e.length;
88
- }, stringIsJson = function e(t) {
89
- return !!isString(t) && (t = t.replace(/\s/g, "").replace(/\n|\r/, ""), /^\{(.*?)\}$/.test(t) ? /"(.*?)":(.*?)/g.test(t) : !!/^\[(.*?)\]$/.test(t) && t.replace(/^\[/, "").replace(/\]$/, "").replace(/},{/g, "}\n{").split(/\n/).map((function(t) {
90
- return e(t);
88
+ };
89
+
90
+ function _isJSON(e) {
91
+ return !!isString(e) && (e = e.replace(/\s/g, "").replace(/\n|\r/, ""), /^\{(.*?)\}$/.test(e) ? /"(.*?)":(.*?)/g.test(e) : !!/^\[(.*?)\]$/.test(e) && e.replace(/^\[/, "").replace(/\]$/, "").replace(/},{/g, "}\n{").split(/\n/).map((function(e) {
92
+ return _isJSON(e);
91
93
  })).reduce((function(e, t) {
92
94
  return !!t;
93
95
  })));
96
+ }
97
+
98
+ var stringIsJson = function(e) {
99
+ try {
100
+ var t = JSON.parse(e);
101
+ return !(isNil(t) || !isArray(t) && !isObject(t));
102
+ } catch (t) {
103
+ return _isJSON(e);
104
+ }
94
105
  }, isKeyInObject = function(e, t) {
95
106
  isString(e) && (e = [ e ]);
96
107
  var n = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amos-tool",
3
- "version": "1.4.15",
3
+ "version": "1.4.16",
4
4
  "description": "amos ui tool",
5
5
  "main": "index.js",
6
6
  "directories": {