wenay-common 1.0.210 → 1.0.211

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.
@@ -9,6 +9,110 @@ exports.CreatAPIFacadeClient = CreatAPIFacadeClient;
9
9
  exports.CreatAPIFacadeServer = CreatAPIFacadeServer;
10
10
  exports.fMiniTest = fMiniTest;
11
11
  const common_1 = require("./common");
12
+ function funcScreenerClient4(data, obj, wait) {
13
+ const tr = (address) => new Proxy((() => { }), {
14
+ has(target, p) {
15
+ let o = obj();
16
+ for (let a of address) {
17
+ o = o?.[a];
18
+ if (!o)
19
+ break;
20
+ if (o == "null")
21
+ return false;
22
+ }
23
+ o = o?.[p];
24
+ if (o == "null")
25
+ return false;
26
+ return true;
27
+ },
28
+ get(target, p, receiver) {
29
+ if (p === Symbol.iterator) {
30
+ return function* () {
31
+ let o = obj();
32
+ for (let a of address) {
33
+ o = o?.[a];
34
+ if (!o)
35
+ return;
36
+ if (o == "null")
37
+ return;
38
+ }
39
+ if (!o || typeof o !== 'object')
40
+ return;
41
+ for (const key of Object.keys(o)) {
42
+ yield [key, tr([...address, key])];
43
+ }
44
+ };
45
+ }
46
+ let o = obj();
47
+ for (let a of address) {
48
+ o = o?.[a];
49
+ if (!o)
50
+ break;
51
+ if (o == "null")
52
+ return undefined;
53
+ }
54
+ o = o?.[p];
55
+ if (o == "null")
56
+ return undefined;
57
+ return tr([...address, String(p)]);
58
+ },
59
+ apply(target, thisArg, argArray) {
60
+ let o = obj();
61
+ for (let a of address) {
62
+ o = o?.[a];
63
+ if (!o)
64
+ break;
65
+ if (o == "null")
66
+ return undefined;
67
+ }
68
+ if (address.at(-1) == "call") {
69
+ address.length = address.length - 1;
70
+ argArray.splice(0, 1);
71
+ }
72
+ const callback = [];
73
+ const callback2 = [];
74
+ argArray.forEach((el, i) => {
75
+ if (typeof el == "function") {
76
+ callback.push({ func: el, poz: i });
77
+ callback2.push(el);
78
+ argArray[i] = "___FUNC";
79
+ }
80
+ });
81
+ return data.send({ key: address, request: argArray }, wait, callback2);
82
+ },
83
+ ownKeys(target) {
84
+ let o = obj();
85
+ for (let a of address) {
86
+ o = o?.[a];
87
+ if (!o)
88
+ return [];
89
+ if (o == "null")
90
+ return [];
91
+ }
92
+ return typeof o === 'object' && o !== null ? Object.keys(o) : [];
93
+ },
94
+ getOwnPropertyDescriptor(target, p) {
95
+ let o = obj();
96
+ for (let a of address) {
97
+ o = o?.[a];
98
+ if (!o)
99
+ return undefined;
100
+ if (o == "null")
101
+ return undefined;
102
+ }
103
+ if (o && p in o) {
104
+ return {
105
+ value: o[p],
106
+ enumerable: true,
107
+ configurable: true,
108
+ writable: true
109
+ };
110
+ }
111
+ return undefined;
112
+ }
113
+ });
114
+ return tr([]);
115
+ }
12
116
  function funcPromiseServer(data, obj) {
13
117
  const buf = data;
14
118
  data.api({
@@ -213,118 +317,6 @@ function funcScreenerClient2(data, wait) {
213
317
  });
214
318
  return tr2();
215
319
  }
216
- function funcScreenerClient4(data, obj, wait) {
217
- const tr = (address) => new Proxy((() => { }), {
218
- has(target, p) {
219
- let o = obj();
220
- for (let a of address) {
221
- o = o?.[a];
222
- if (!o)
223
- return false;
224
- if (o === "null")
225
- return false;
226
- }
227
- o = o?.[p];
228
- return o !== undefined && o !== "null";
229
- },
230
- get(target, p, receiver) {
231
- if (p === Symbol.iterator) {
232
- return function* () {
233
- let o = obj();
234
- for (let a of address) {
235
- o = o?.[a];
236
- if (!o)
237
- return;
238
- if (o === "null")
239
- return;
240
- }
241
- if (!o || typeof o !== 'object')
242
- return;
243
- for (const key in o) {
244
- if (o.hasOwnProperty(key)) {
245
- yield [key, tr([...address, key])];
246
- }
247
- }
248
- };
249
- }
250
- if (p === Symbol.toStringTag) {
251
- return 'Object';
252
- }
253
- let o = obj();
254
- for (let a of address) {
255
- o = o?.[a];
256
- if (!o)
257
- return undefined;
258
- if (o === "null")
259
- return undefined;
260
- }
261
- o = o?.[p];
262
- if (o === "null")
263
- return undefined;
264
- return tr([...address, String(p)]);
265
- },
266
- apply(target, thisArg, argArray) {
267
- let o = obj();
268
- for (let a of address) {
269
- o = o?.[a];
270
- if (!o)
271
- return undefined;
272
- if (o === "null")
273
- return undefined;
274
- }
275
- if (address.at(-1) === "call") {
276
- address.length = address.length - 1;
277
- argArray.splice(0, 1);
278
- }
279
- const callback = [];
280
- const callback2 = [];
281
- argArray.forEach((el, i) => {
282
- if (typeof el === "function") {
283
- callback.push({ func: el, poz: i });
284
- callback2.push(el);
285
- argArray[i] = "___FUNC";
286
- }
287
- });
288
- return data.send({ key: address, request: argArray }, wait, callback2);
289
- },
290
- ownKeys(target) {
291
- let o = obj();
292
- for (let a of address) {
293
- o = o?.[a];
294
- if (!o)
295
- return [];
296
- if (o === "null")
297
- return [];
298
- }
299
- return Object.keys(o || {});
300
- },
301
- getOwnPropertyDescriptor(target, p) {
302
- let o = obj();
303
- for (let a of address) {
304
- o = o?.[a];
305
- if (!o)
306
- return undefined;
307
- if (o === "null")
308
- return undefined;
309
- }
310
- if (!(p in o))
311
- return undefined;
312
- return {
313
- value: tr([...address, String(p)]),
314
- enumerable: true,
315
- configurable: true,
316
- writable: true
317
- };
318
- },
319
- deleteProperty(target, p) {
320
- return false;
321
- },
322
- set(target, p, value, receiver) {
323
- return false;
324
- }
325
- });
326
- return tr([]);
327
- }
328
320
  function funcScreenerClient3(data, obj, wait) {
329
321
  const tr = (address) => new Proxy((() => { }), {
330
322
  has(target, p) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wenay-common",
3
- "version": "1.0.210",
3
+ "version": "1.0.211",
4
4
  "description": "Common library",
5
5
  "strict": true,
6
6
  "main": "lib/index.js",