efront 4.35.4 → 4.35.6

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 (84) hide show
  1. package/apps/_index.html +41 -41
  2. package/apps/blank/index.html +20 -20
  3. package/apps/noice/index.html +42 -42
  4. package/apps/pay/paypal.jsp +0 -0
  5. package/apps/pay/wxpay.jsp +32 -0
  6. package/apps/pivot/dht/rent.html +14 -0
  7. package/apps/pivot/dht/rent.js +148 -0
  8. package/apps/pivot/dht/rent.less +46 -0
  9. package/apps/pivot/home/desktop.xht +0 -0
  10. package/apps/pivot/menu.yml +6 -1
  11. package/apps/pivot/shop/goods/list.xht +183 -0
  12. package/apps/pivot/shop/home.xht +20 -0
  13. package/apps/pivot/shop/mind/list.xht +1 -0
  14. package/apps/pivot/shop/order/create.xht +49 -0
  15. package/apps/pivot/shop/order/list.xht +1 -0
  16. package/apps/pivot/shop/paypal.jsp +23 -0
  17. package/apps/pivot/soft/list.html +0 -0
  18. package/apps/pivot/soft/list.js +9 -0
  19. package/apps/pivot/soft/list.less +0 -0
  20. package/apps/pivot//344/270/273/351/241/265.html +42 -42
  21. package/coms/7z_temp/Java.js +93 -0
  22. package/coms/7z_temp/LzmaBench.java +392 -0
  23. package/coms/7z_temp/read-from-java-code.js +28 -0
  24. package/coms/7z_temp//350/257/264/346/230/216.md +1 -0
  25. package/coms/basic/JSAM.js +259 -259
  26. package/coms/basic/JSAM_test.js +3 -5
  27. package/coms/basic/check.js +42 -42
  28. package/coms/basic/color.js +696 -696
  29. package/coms/basic/crc.js +39 -39
  30. package/coms/basic/getIndexFromOrderedArray.js +39 -39
  31. package/coms/basic/isObject.js +3 -3
  32. package/coms/basic/keys.js +4 -4
  33. package/coms/basic/lazy.js +78 -78
  34. package/coms/basic/math.js +7 -1
  35. package/coms/basic/math.md +11 -0
  36. package/coms/basic/refilm.js +96 -96
  37. package/coms/basic/saveToOrderedArray.js +11 -11
  38. package/coms/basic/strings.js +7 -5
  39. package/coms/basic_/&pget.js +1 -0
  40. package/coms/basic_/&pset.js +1 -0
  41. package/coms/basic_/Proxy.js +6 -0
  42. package/coms/basic_/Reflect.js +55 -0
  43. package/coms/compile/Html.js +15 -7
  44. package/coms/compile/Program.js +3 -1
  45. package/coms/compile/autoeval.js +26 -7
  46. package/coms/compile/autoeval_test.js +9 -0
  47. package/coms/compile/bracket.js +51 -0
  48. package/coms/compile/bracket_test.js +9 -0
  49. package/coms/compile/createvm.js +35 -0
  50. package/coms/compile/createvm_test.js +7 -0
  51. package/coms/compile/scanner.js +653 -653
  52. package/coms/compile/scanner2.js +24 -1
  53. package/coms/compile//347/264/240/351/246/250.js +4 -4
  54. package/coms/docs/getMimeData_test.js +19 -19
  55. package/coms/docs/md5.js +173 -173
  56. package/coms/frame/top.less +190 -190
  57. package/coms/pivot/DB.js +9 -0
  58. package/coms/pivot/paypal-var.js +1 -0
  59. package/coms/pivot//345/225/206/345/223/201.js +1 -0
  60. package/coms/zimoli/AudioContext_test.html +5 -5
  61. package/coms/zimoli/AudioContext_test.js +92 -92
  62. package/coms/zimoli/AudioContext_test.less +114 -114
  63. package/coms/zimoli/alert_test.js +11 -11
  64. package/coms/zimoli/dispatch.js +50 -50
  65. package/coms/zimoli/extendTouchEvent.js +8 -8
  66. package/coms/zimoli/fullscreen.js +52 -52
  67. package/coms/zimoli/gallery.less +13 -13
  68. package/coms/zimoli/gallery_test.html +2 -2
  69. package/coms/zimoli/gallery_test.js +14 -14
  70. package/coms/zimoli/gallery_test.less +17 -17
  71. package/coms/zimoli/getChanged.js +7 -7
  72. package/coms/zimoli/getChanges.js +13 -13
  73. package/coms/zimoli/lattice.js +109 -109
  74. package/coms/zimoli/lattice_test.less +23 -23
  75. package/coms/zimoli/picture.less +71 -71
  76. package/coms/zimoli/refilm_test.html +41 -41
  77. package/coms/zimoli/refilm_test.less +102 -102
  78. package/coms/zimoli/xml.js +131 -131
  79. package/data/keystore/cross-cert.pem +21 -21
  80. package/data/keystore/cross-key.pem +27 -27
  81. package/package.json +1 -1
  82. package/public/efront.js +1 -1
  83. package/public//346/226/207/344/273/266/347/263/273/347/273/237//344/270/273/351/241/265.jsp +2 -2
  84. /package/apps/pivot/{tick → ticket}/list.js +0 -0
@@ -1,260 +1,260 @@
1
- var strings = require("./strings");
2
- var spaces = require("./spaces");
3
- var isArrayLike = require("./isArrayLike");
4
- var check = function (o) {
5
- return o === null || o === false || o === true || o === Infinity || o !== o;
6
- };
7
- var string = function (a) {
8
- return strings.encode(a, '"', false);
9
- };
10
- var symbol = function (a) {
11
- return strings.encode(String(a).replace(/^\w*\(([\s\S]*)\)$/, '$1'), "'");
12
- };
13
- var date = function (d) {
14
- return d.toISOString();
15
- };
16
- var regrep = a => a === '/' ? "\\/" : a;
17
- var regexp = function (r) {
18
- return '/' + r.source.replace(/\\[\s\S]|\//g, regrep) + '/' + r.flags;
19
- };
20
- var isValidK = function (k) {
21
- return k.length < 16 && !/^\d|[,:'"\\\/`\-\[\]\{\}\(\)\.\+\#\@\&^]/.test(k) && spaces.trim(k) === k;
22
- };
23
- var extractK = function (k) {
24
- return /^\d{1,16}$/.test(k) && !/^0\d/.test(k);
25
- };
26
- var noDulp = false, plength = 0, dulp = false;
27
- var hasOwnProperty = {}.hasOwnProperty;
28
- function _tostring(memery, preload, dist) {
29
- if (memery === undefined) return '';
30
- if (check(memery)) return String(memery);
31
- if (typeof memery === 'number') {
32
- if (memery < 0) return String(memery);
33
- return "+" + String(memery);
34
- }
35
- if (typeof memery === 'string') return string(memery);
36
- if (typeof memery === 'symbol' || memery instanceof Symbol) return symbol(memery);
37
- if (typeof memery === 'bigint' || memery instanceof BigInt) return String(memery) + "n";
38
- m: if (typeof memery === 'function') {
39
- for (var k in memery) break m;
40
- return '';
41
- }
42
- if (memery instanceof Date) return date(memery);
43
- if (memery instanceof RegExp) return regexp(memery);
44
- var constructor = memery.constructor;
45
- var d = preload.indexOf(constructor);
46
- var pre = memery instanceof Array ? "[" : "{";
47
- var aft = pre === "{" ? "}" : "]"
48
- if (d >= 0) pre = d + pre;
49
- var inc = 0, arr = [];
50
- var index = dist.length;
51
- dist.push(undefined);
52
- for (var k in memery) {
53
- var v = memery[k];
54
- if (!hasOwnProperty.call(memery, k)) {
55
- if (!d || !hasOwnProperty.call(constructor.prototype, k)) break;
56
- }
57
- if (v && typeof v === 'object' || typeof v === 'function') {
58
- if (v instanceof Date) {
59
- v = date(v);
60
- }
61
- else if (v instanceof RegExp) {
62
- v = regexp(v);
63
- }
64
- else {
65
- var i = preload.indexOf(v);
66
- if (i >= 0) {
67
- if (noDulp) throw new Error(i18n`数据异常`);
68
- v = i;
69
- dulp = true;
70
- }
71
- else {
72
- i = plength + dist.length;
73
- preload.push(v);
74
- v = _tostring(v, preload, dist);
75
- if (!v.length) {
76
- preload.pop();
77
- continue;
78
- }
79
- if (noDulp) preload.pop();
80
- v = i;
81
- }
82
- }
83
- }
84
- else {
85
- v = _tostring(v, preload);
86
- }
87
-
88
- if (extractK(k)) {
89
- if (+k === inc) arr.push(v);
90
- else arr.push("+" + k + ":" + v);
91
- }
92
- else {
93
- if (!isValidK(k)) k = string(String(k));
94
- arr.push(k + ":" + v);
95
- }
96
- inc++;
97
- }
98
- if (arr.length && !arr[arr.length - 1].length) arr.push('');
99
- dist[index] = pre + arr.join(',') + aft;
100
- return dist[index];
101
- }
102
-
103
- function stringify(memery, preload, hasDulp = true) {
104
- noDulp = preload === false || hasDulp === false;
105
- if (isArrayLike(hasDulp)) preload = hasDulp;
106
- if (isArrayLike(preload)) {
107
- preload = Array.apply(null, preload);
108
- var i = preload.indexOf(memery) + 1;
109
- if (i > 0) return i + ',';
110
- preload.unshift(memery);
111
- }
112
- else preload = [memery];
113
- var dist = [];
114
- plength = preload.length - 1;
115
- dulp = false;
116
- dist[0] = _tostring(memery, preload, dist);
117
- if (dist.length === 1 && dulp) { dist.push(''); }
118
- return dist.join(',');
119
- }
120
- function parseValue(v) {
121
- if (/^"/.test(v)) return strings.decode(v);
122
- if (/^[\+\-]?\d+n$/.test(v)) return BigInt(v.slice(0, v.length - 1));
123
- if (/^[\+\-]\d/.test(v)) return parseFloat(v);
124
- if (/^\d+[\-\/]/.test(v)) return new Date(v);
125
- if (/^\d/.test(v)) return parseFloat(v);
126
- switch (v) {
127
- case "true": return true;
128
- case "false": return false;
129
- case "null": return null;
130
- case "": return undefined;
131
- case "Infinity": return Infinity;
132
- case "NaN": return NaN;
133
- }
134
- if (/^\//.test(v)) {
135
- var flag = /\/(\w*)$/.exec(v);
136
- return new RegExp(v.slice(1, flag.index), flag[1]);
137
- }
138
- if (/^'/.test(v)) return Symbol(strings.decode(v));
139
- return v;
140
- }
141
- function setkd([obj, kds]) {
142
- if (!isjsam) return kds.forEach(setkv, obj);
143
- for (var [k, d] of kds) {
144
- if (typeof k === 'number');
145
- else if (/^\d+$/.test(k)) k = this[k];
146
- else k = parseValue(k);
147
- if (d instanceof Object);
148
- else if (d.length <= 16 && /^\d+$/.test(d)) d = this[d];
149
- else d = parseValue(d);
150
- obj[k] = d;
151
- }
152
- }
153
- function setkv([k, v]) {
154
- if (typeof k === 'number');
155
- else if (/^\d+$/.test(k));
156
- else k = parseValue(k);
157
- if (v instanceof Object);
158
- else v = parseValue(v);
159
- this[k] = v;
160
- }
161
- var blocks = [];
162
- var isjsam = false;
163
- function scanblock(string, index, preload, obj) {
164
- var reg = /\\[\s\S]|[\:,'"\}\]\{\[\/]/g;
165
- reg.lastIndex = index;
166
- var instr = false;
167
- var inc = index === 0 ? preload.length : 1, k = 0, d = null;
168
- var start = index;
169
- var kds = [];
170
- a: while (index < string.length) {
171
- var match = reg.exec(string);
172
- if (!match) {
173
- index = string.length;
174
- break;
175
- }
176
- var m = match[0];
177
- index = match.index + m.length;
178
- if (/^['"\/]$/.test(m)) {
179
- if (instr === m) {
180
- instr = false;
181
- }
182
- else if (instr) continue;
183
- else instr = m;
184
- }
185
- else if (instr) continue;
186
- switch (m) {
187
- case ":":
188
- if (index > start + 10 && /^\d+[\/\-]/.test(string.slice(start, start + 10))) {
189
- continue;
190
- }
191
- k = spaces.trim(string.slice(start, match.index));
192
- start = index;
193
- continue;
194
- case ",":
195
- d = spaces.trim(string.slice(start, match.index));
196
- if (preload === obj) isjsam = true;
197
- if (!d && typeof k === 'number' && !(obj instanceof Array)) {
198
- start = index;
199
- k = inc++;
200
- continue;
201
- }
202
- if (preload === obj) {
203
- preload[k] = parseValue(d);
204
- }
205
- else kds.push([k, d]);
206
- k = inc++;
207
- start = index;
208
- continue;
209
- case "{":
210
- var o = {};
211
- case "[":
212
- var o = o || [];
213
- d = spaces.trim(string.slice(start, match.index));
214
- if (d) {
215
- d = preload[d];
216
- if (!d) throw new Error('数据异常!');
217
- if (Object.setPrototypeOf) Object.setPrototypeOf(o, d.prototype);
218
- else o = Object.create(d.prototype);
219
- }
220
- if (preload === obj) {
221
- preload[k] = o;
222
- }
223
- else {
224
- kds.push([k, o]);
225
- }
226
- index = start = scanblock(string, index, preload, o, isjsam);
227
- o = null;
228
- k = inc;
229
- reg.lastIndex = index;
230
- break;
231
- case "}": case "]":
232
- index = match.index;
233
- break a;
234
- }
235
- }
236
- if (start < index) {
237
- var d = spaces.trim(string.slice(start, index));
238
- if (typeof k !== 'number' || d) {
239
- if (obj === preload) preload[k] = parseValue(d);
240
- else kds.push([k, d]);
241
- }
242
- }
243
- blocks.push([obj, kds]);
244
- return reg.lastIndex;
245
- }
246
- function parse(string, preload) {
247
- if (isArrayLike(preload)) preload = Array.apply(null, preload);
248
- else preload = [];
249
- isjsam = false;
250
- preload.unshift(void 0);
251
- string = String(string);
252
- scanblock(string, 0, preload, preload);
253
- blocks.forEach(setkd, preload);
254
- blocks = [];
255
- return preload[0];
256
- }
257
- module.exports = {
258
- stringify,
259
- parse,
1
+ var strings = require("./strings");
2
+ var spaces = require("./spaces");
3
+ var isArrayLike = require("./isArrayLike");
4
+ var check = function (o) {
5
+ return o === null || o === false || o === true || o === Infinity || o !== o;
6
+ };
7
+ var string = function (a) {
8
+ return strings.encode(a, '"', false);
9
+ };
10
+ var symbol = function (a) {
11
+ return strings.encode(String(a).replace(/^\w*\(([\s\S]*)\)$/, '$1'), "'");
12
+ };
13
+ var date = function (d) {
14
+ return d.toISOString();
15
+ };
16
+ var regrep = a => a === '/' ? "\\/" : a;
17
+ var regexp = function (r) {
18
+ return '/' + r.source.replace(/\\[\s\S]|\//g, regrep) + '/' + r.flags;
19
+ };
20
+ var isValidK = function (k) {
21
+ return k.length < 16 && !/^\d|[,:'"\\\/`\-\[\]\{\}\(\)\.\+\#\@\&^]/.test(k) && spaces.trim(k) === k;
22
+ };
23
+ var extractK = function (k) {
24
+ return /^\d{1,16}$/.test(k) && !/^0\d/.test(k);
25
+ };
26
+ var noDulp = false, plength = 0, dulp = false;
27
+ var hasOwnProperty = {}.hasOwnProperty;
28
+ function _tostring(memery, preload, dist) {
29
+ if (memery === undefined) return '';
30
+ if (check(memery)) return String(memery);
31
+ if (typeof memery === 'number') {
32
+ if (memery < 0) return String(memery);
33
+ return "+" + String(memery);
34
+ }
35
+ if (typeof memery === 'string') return string(memery);
36
+ if (typeof memery === 'symbol' || memery instanceof Symbol) return symbol(memery);
37
+ if (typeof memery === 'bigint' || memery instanceof BigInt) return String(memery) + "n";
38
+ m: if (typeof memery === 'function') {
39
+ for (var k in memery) break m;
40
+ return '';
41
+ }
42
+ if (memery instanceof Date) return date(memery);
43
+ if (memery instanceof RegExp) return regexp(memery);
44
+ var constructor = memery.constructor;
45
+ var d = preload.indexOf(constructor);
46
+ var pre = memery instanceof Array ? "[" : "{";
47
+ var aft = pre === "{" ? "}" : "]"
48
+ if (d >= 0) pre = d + pre;
49
+ var inc = 0, arr = [];
50
+ var index = dist.length;
51
+ dist.push(undefined);
52
+ for (var k in memery) {
53
+ var v = memery[k];
54
+ if (!hasOwnProperty.call(memery, k)) {
55
+ if (!d || !hasOwnProperty.call(constructor.prototype, k)) break;
56
+ }
57
+ if (v && typeof v === 'object' || typeof v === 'function') {
58
+ if (v instanceof Date) {
59
+ v = date(v);
60
+ }
61
+ else if (v instanceof RegExp) {
62
+ v = regexp(v);
63
+ }
64
+ else {
65
+ var i = preload.indexOf(v);
66
+ if (i >= 0) {
67
+ if (noDulp) throw new Error(i18n`数据异常`);
68
+ v = i;
69
+ dulp = true;
70
+ }
71
+ else {
72
+ i = plength + dist.length;
73
+ preload.push(v);
74
+ v = _tostring(v, preload, dist);
75
+ if (!v.length) {
76
+ preload.pop();
77
+ continue;
78
+ }
79
+ if (noDulp) preload.pop();
80
+ v = i;
81
+ }
82
+ }
83
+ }
84
+ else {
85
+ v = _tostring(v, preload);
86
+ }
87
+
88
+ if (extractK(k)) {
89
+ if (+k === inc) arr.push(v);
90
+ else arr.push("+" + k + ":" + v);
91
+ }
92
+ else {
93
+ if (!isValidK(k)) k = string(String(k));
94
+ arr.push(k + ":" + v);
95
+ }
96
+ inc++;
97
+ }
98
+ if (arr.length && !arr[arr.length - 1].length) arr.push('');
99
+ dist[index] = pre + arr.join(',') + aft;
100
+ return dist[index];
101
+ }
102
+
103
+ function stringify(memery, preload, hasDulp = true) {
104
+ noDulp = preload === false || hasDulp === false;
105
+ if (isArrayLike(hasDulp)) preload = hasDulp;
106
+ if (isArrayLike(preload)) {
107
+ preload = Array.apply(null, preload);
108
+ var i = preload.indexOf(memery) + 1;
109
+ if (i > 0) return i + ',';
110
+ preload.unshift(memery);
111
+ }
112
+ else preload = [memery];
113
+ var dist = [];
114
+ plength = preload.length - 1;
115
+ dulp = false;
116
+ dist[0] = _tostring(memery, preload, dist);
117
+ if (dist.length === 1 && dulp) { dist.push(''); }
118
+ return dist.join(',');
119
+ }
120
+ function parseValue(v) {
121
+ if (/^"/.test(v)) return strings.decode(v);
122
+ if (/^[\+\-]?\d+n$/.test(v)) return BigInt(v.slice(0, v.length - 1));
123
+ if (/^[\+\-]\d/.test(v)) return parseFloat(v);
124
+ if (/^\d+[\-\/]/.test(v)) return new Date(v);
125
+ if (/^\d/.test(v)) return parseFloat(v);
126
+ switch (v) {
127
+ case "true": return true;
128
+ case "false": return false;
129
+ case "null": return null;
130
+ case "": return undefined;
131
+ case "Infinity": return Infinity;
132
+ case "NaN": return NaN;
133
+ }
134
+ if (/^\//.test(v)) {
135
+ var flag = /\/(\w*)$/.exec(v);
136
+ return new RegExp(v.slice(1, flag.index), flag[1]);
137
+ }
138
+ if (/^'/.test(v)) return Symbol(strings.decode(v));
139
+ return v;
140
+ }
141
+ function setkd([obj, kds]) {
142
+ if (!isjsam) return kds.forEach(setkv, obj);
143
+ for (var [k, d] of kds) {
144
+ if (typeof k === 'number');
145
+ else if (/^\d+$/.test(k)) k = this[k];
146
+ else k = parseValue(k);
147
+ if (d instanceof Object);
148
+ else if (d.length <= 16 && /^\d+$/.test(d)) d = this[d];
149
+ else d = parseValue(d);
150
+ obj[k] = d;
151
+ }
152
+ }
153
+ function setkv([k, v]) {
154
+ if (typeof k === 'number');
155
+ else if (/^\d+$/.test(k));
156
+ else k = parseValue(k);
157
+ if (v instanceof Object);
158
+ else v = parseValue(v);
159
+ this[k] = v;
160
+ }
161
+ var blocks = [];
162
+ var isjsam = false;
163
+ function scanblock(string, index, preload, obj) {
164
+ var reg = /\\[\s\S]|[\:,'"\}\]\{\[\/]/g;
165
+ reg.lastIndex = index;
166
+ var instr = false;
167
+ var inc = index === 0 ? preload.length : 1, k = 0, d = null;
168
+ var start = index;
169
+ var kds = [];
170
+ a: while (index < string.length) {
171
+ var match = reg.exec(string);
172
+ if (!match) {
173
+ index = string.length;
174
+ break;
175
+ }
176
+ var m = match[0];
177
+ index = match.index + m.length;
178
+ if (/^['"\/]$/.test(m)) {
179
+ if (instr === m) {
180
+ instr = false;
181
+ }
182
+ else if (instr) continue;
183
+ else instr = m;
184
+ }
185
+ else if (instr) continue;
186
+ switch (m) {
187
+ case ":":
188
+ if (index > start + 10 && /^\d+[\/\-]/.test(string.slice(start, start + 10))) {
189
+ continue;
190
+ }
191
+ k = spaces.trim(string.slice(start, match.index));
192
+ start = index;
193
+ continue;
194
+ case ",":
195
+ d = spaces.trim(string.slice(start, match.index));
196
+ if (preload === obj) isjsam = true;
197
+ if (!d && typeof k === 'number' && !(obj instanceof Array)) {
198
+ start = index;
199
+ k = inc++;
200
+ continue;
201
+ }
202
+ if (preload === obj) {
203
+ preload[k] = parseValue(d);
204
+ }
205
+ else kds.push([k, d]);
206
+ k = inc++;
207
+ start = index;
208
+ continue;
209
+ case "{":
210
+ var o = {};
211
+ case "[":
212
+ var o = o || [];
213
+ d = spaces.trim(string.slice(start, match.index));
214
+ if (d) {
215
+ d = preload[d];
216
+ if (!d) throw new Error('数据异常!');
217
+ if (Object.setPrototypeOf) Object.setPrototypeOf(o, d.prototype);
218
+ else o = Object.create(d.prototype);
219
+ }
220
+ if (preload === obj) {
221
+ preload[k] = o;
222
+ }
223
+ else {
224
+ kds.push([k, o]);
225
+ }
226
+ index = start = scanblock(string, index, preload, o, isjsam);
227
+ o = null;
228
+ k = inc;
229
+ reg.lastIndex = index;
230
+ break;
231
+ case "}": case "]":
232
+ index = match.index;
233
+ break a;
234
+ }
235
+ }
236
+ if (start < index) {
237
+ var d = spaces.trim(string.slice(start, index));
238
+ if (typeof k !== 'number' || d) {
239
+ if (obj === preload) preload[k] = parseValue(d);
240
+ else kds.push([k, d]);
241
+ }
242
+ }
243
+ blocks.push([obj, kds]);
244
+ return reg.lastIndex;
245
+ }
246
+ function parse(string, preload) {
247
+ if (isArrayLike(preload)) preload = Array.apply(null, preload);
248
+ else preload = [];
249
+ isjsam = false;
250
+ preload.unshift(void 0);
251
+ string = String(string);
252
+ scanblock(string, 0, preload, preload);
253
+ blocks.forEach(setkd, preload);
254
+ blocks = [];
255
+ return preload[0];
256
+ }
257
+ module.exports = {
258
+ stringify,
259
+ parse,
260
260
  };
@@ -11,10 +11,10 @@ var test_self = function () {
11
11
  test(null) // null;
12
12
  test(undefined); // 空字符串
13
13
  test(1); // 1
14
- test([0]);
14
+ test([0]);
15
15
  test(["00"]);
16
- test({"0":"00"});
17
- test({"00":"00"});
16
+ test({ "0": "00" });
17
+ test({ "00": "00" });
18
18
  test(true); // true
19
19
  test(false); // false
20
20
  test(NaN); // NaN
@@ -353,10 +353,8 @@ function test_encode() {
353
353
  function JSAM_test() {
354
354
  test_self();
355
355
  test_json();
356
- JSAM.debug = true;
357
356
  test_deep();
358
357
  test_parse();
359
- JSAM.debug = false;
360
358
  test_time();
361
359
  test_encode();
362
360
  }
@@ -1,43 +1,43 @@
1
- // [] 表示或,{} 表示且,如:
2
- // needs = { attr1: [value1, value2] }
3
- // needs = { attr1: value1 }
4
- // needs = [{ attr1: [value1,value2] }, { attr2: value3 }]
5
-
6
- var typereg = /^(number|boolean|bigint)$/;
7
- var checkValue = function (current, needs) {
8
- if (needs instanceof Array) {
9
- for (var cx = 0, dx = needs.length; cx < dx; cx++) {
10
- var value = needs[cx];
11
- if (checkValue(current, value)) return true;
12
- }
13
- return false;
14
- }
15
- if (isFunction(needs)) return needs(current);
16
- if (current === needs) return true;
17
- if (isEmpty(current) && isEmpty(needs)) return true;
18
- if (typereg.test(typeof current) && typereg.test(typeof needs) && +current === +needs) return true;
19
- if (!isEmpty(current) && !isEmpty(needs) && +current === +needs) return true;
20
- return false;
21
- };
22
- var check = function (data, needs) {
23
- if (!needs) return true;
24
- if (needs instanceof Array) {
25
- for (var cx = 0, dx = needs.length; cx < dx; cx++) {
26
- var need = needs[cx];
27
- if (check(data, need)) return true;
28
- }
29
- return false;
30
- }
31
- if (!data) return false;
32
- if (isObject(needs)) {
33
- for (var k in needs) {
34
- if (/!$/.test(k)) {
35
- if (checkValue(seek(data, k.slice(0, k.length - 1)), needs[k])) return false;
36
- }
37
- else if (!checkValue(seek(data, k), needs[k])) return false;
38
- }
39
- return true;
40
- }
41
- return needs === true;
42
- };
1
+ // [] 表示或,{} 表示且,如:
2
+ // needs = { attr1: [value1, value2] }
3
+ // needs = { attr1: value1 }
4
+ // needs = [{ attr1: [value1,value2] }, { attr2: value3 }]
5
+
6
+ var typereg = /^(number|boolean|bigint)$/;
7
+ var checkValue = function (current, needs) {
8
+ if (needs instanceof Array) {
9
+ for (var cx = 0, dx = needs.length; cx < dx; cx++) {
10
+ var value = needs[cx];
11
+ if (checkValue(current, value)) return true;
12
+ }
13
+ return false;
14
+ }
15
+ if (isFunction(needs)) return needs(current);
16
+ if (current === needs) return true;
17
+ if (isEmpty(current) && isEmpty(needs)) return true;
18
+ if (typereg.test(typeof current) && typereg.test(typeof needs) && +current === +needs) return true;
19
+ if (!isEmpty(current) && !isEmpty(needs) && +current === +needs) return true;
20
+ return false;
21
+ };
22
+ var check = function (data, needs) {
23
+ if (!needs) return true;
24
+ if (needs instanceof Array) {
25
+ for (var cx = 0, dx = needs.length; cx < dx; cx++) {
26
+ var need = needs[cx];
27
+ if (check(data, need)) return true;
28
+ }
29
+ return false;
30
+ }
31
+ if (!data) return false;
32
+ if (isObject(needs)) {
33
+ for (var k in needs) {
34
+ if (/!$/.test(k)) {
35
+ if (checkValue(seek(data, k.slice(0, k.length - 1)), needs[k])) return false;
36
+ }
37
+ else if (!checkValue(seek(data, k), needs[k])) return false;
38
+ }
39
+ return true;
40
+ }
41
+ return needs === true;
42
+ };
43
43
  check.default = check.check = check;