wenay-common 1.0.209 → 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({
@@ -307,7 +411,7 @@ function CreatAPIFacadeClient({ socketKey, socket, limit }) {
307
411
  limit
308
412
  });
309
413
  const func = funcScreenerClient2(tr);
310
- const strictly = funcScreenerClient3(tr, () => strictlyObj);
414
+ const strictly = funcScreenerClient4(tr, () => strictlyObj);
311
415
  const space = funcScreenerClient2(tr, false);
312
416
  return {
313
417
  api: tr.api,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wenay-common",
3
- "version": "1.0.209",
3
+ "version": "1.0.211",
4
4
  "description": "Common library",
5
5
  "strict": true,
6
6
  "main": "lib/index.js",