tnp-core 13.2.9 → 13.2.11

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 (98) hide show
  1. package/README.md +20 -20
  2. package/app.js +3 -3
  3. package/browser/README.md +24 -24
  4. package/browser/esm2020/lib/core-config.mjs +6 -6
  5. package/browser/esm2020/lib/core-imports.mjs +68 -68
  6. package/browser/esm2020/lib/core-models.mjs +3 -3
  7. package/browser/esm2020/lib/framework-name.mjs +9 -9
  8. package/browser/esm2020/lib/helpers-isomorphic.mjs +35 -35
  9. package/browser/esm2020/lib/helpers-messages.mjs +493 -493
  10. package/browser/esm2020/lib/helpers.mjs +1178 -1178
  11. package/browser/esm2020/lib/index.mjs +10 -10
  12. package/browser/esm2020/lib/node-path-mock.mjs +414 -414
  13. package/browser/esm2020/lib/progress-data.mjs +51 -51
  14. package/browser/esm2020/public-api.mjs +1 -1
  15. package/browser/esm2020/tnp-core.mjs +4 -4
  16. package/browser/fesm2015/tnp-core.mjs +2195 -2195
  17. package/browser/fesm2020/tnp-core.mjs +2193 -2193
  18. package/browser/lib/core-config.d.ts +4 -4
  19. package/browser/lib/core-imports.d.ts +7 -7
  20. package/browser/lib/core-models.d.ts +41 -41
  21. package/browser/lib/framework-name.d.ts +1 -1
  22. package/browser/lib/helpers-isomorphic.d.ts +5 -5
  23. package/browser/lib/helpers-messages.d.ts +16 -16
  24. package/browser/lib/helpers.d.ts +49 -49
  25. package/browser/lib/index.d.ts +7 -7
  26. package/browser/lib/node-path-mock.d.ts +24 -24
  27. package/browser/lib/progress-data.d.ts +17 -17
  28. package/browser/tnp-core.d.ts +4 -4
  29. package/cli.backend.js +3 -3
  30. package/client/README.md +24 -24
  31. package/client/esm2020/lib/core-config.mjs +6 -6
  32. package/client/esm2020/lib/core-imports.mjs +68 -68
  33. package/client/esm2020/lib/core-models.mjs +3 -3
  34. package/client/esm2020/lib/framework-name.mjs +9 -9
  35. package/client/esm2020/lib/helpers-isomorphic.mjs +35 -35
  36. package/client/esm2020/lib/helpers-messages.mjs +493 -493
  37. package/client/esm2020/lib/helpers.mjs +1178 -1178
  38. package/client/esm2020/lib/index.mjs +10 -10
  39. package/client/esm2020/lib/node-path-mock.mjs +414 -414
  40. package/client/esm2020/lib/progress-data.mjs +51 -51
  41. package/client/esm2020/public-api.mjs +1 -1
  42. package/client/esm2020/tnp-core.mjs +4 -4
  43. package/client/fesm2015/tnp-core.mjs +2195 -2195
  44. package/client/fesm2020/tnp-core.mjs +2193 -2193
  45. package/client/lib/core-config.d.ts +4 -4
  46. package/client/lib/core-imports.d.ts +7 -7
  47. package/client/lib/core-models.d.ts +41 -41
  48. package/client/lib/framework-name.d.ts +1 -1
  49. package/client/lib/helpers-isomorphic.d.ts +5 -5
  50. package/client/lib/helpers-messages.d.ts +16 -16
  51. package/client/lib/helpers.d.ts +49 -49
  52. package/client/lib/index.d.ts +7 -7
  53. package/client/lib/node-path-mock.d.ts +24 -24
  54. package/client/lib/progress-data.d.ts +17 -17
  55. package/client/tnp-core.d.ts +4 -4
  56. package/index.d.ts +1 -1
  57. package/lib/core-config.d.ts +5 -5
  58. package/lib/core-imports.d.ts +30 -30
  59. package/lib/core-models.d.ts +42 -42
  60. package/lib/framework-name.d.ts +2 -2
  61. package/lib/helpers-isomorphic.d.ts +6 -6
  62. package/lib/helpers-messages.d.ts +33 -33
  63. package/lib/helpers.d.ts +128 -128
  64. package/lib/index.d.ts +8 -8
  65. package/lib/node-path-mock.d.ts +24 -24
  66. package/lib/node-path-mock.js +3 -3
  67. package/lib/progress-data.d.ts +18 -18
  68. package/lib/public-api.d.ts +7 -7
  69. package/package.json +2 -2
  70. package/package.json_devDependencies.json +202 -202
  71. package/package.json_tnp.json5 +65 -65
  72. package/tmp-environment.json +13 -13
  73. package/websql/README.md +24 -24
  74. package/websql/esm2020/lib/core-config.mjs +6 -6
  75. package/websql/esm2020/lib/core-imports.mjs +68 -68
  76. package/websql/esm2020/lib/core-models.mjs +3 -3
  77. package/websql/esm2020/lib/framework-name.mjs +9 -9
  78. package/websql/esm2020/lib/helpers-isomorphic.mjs +34 -34
  79. package/websql/esm2020/lib/helpers-messages.mjs +493 -493
  80. package/websql/esm2020/lib/helpers.mjs +1176 -1176
  81. package/websql/esm2020/lib/index.mjs +10 -10
  82. package/websql/esm2020/lib/node-path-mock.mjs +414 -414
  83. package/websql/esm2020/lib/progress-data.mjs +51 -51
  84. package/websql/esm2020/public-api.mjs +1 -1
  85. package/websql/esm2020/tnp-core.mjs +4 -4
  86. package/websql/fesm2015/tnp-core.mjs +2192 -2192
  87. package/websql/fesm2020/tnp-core.mjs +2190 -2190
  88. package/websql/lib/core-config.d.ts +4 -4
  89. package/websql/lib/core-imports.d.ts +7 -7
  90. package/websql/lib/core-models.d.ts +41 -41
  91. package/websql/lib/framework-name.d.ts +1 -1
  92. package/websql/lib/helpers-isomorphic.d.ts +5 -5
  93. package/websql/lib/helpers-messages.d.ts +16 -16
  94. package/websql/lib/helpers.d.ts +49 -49
  95. package/websql/lib/index.d.ts +7 -7
  96. package/websql/lib/node-path-mock.d.ts +24 -24
  97. package/websql/lib/progress-data.d.ts +17 -17
  98. package/websql/tnp-core.d.ts +4 -4
@@ -9,2218 +9,2218 @@ export { dateformat };
9
9
  import { __awaiter } from 'tslib';
10
10
  import { Subject } from 'rxjs';
11
11
 
12
- let isBrowser = false;
13
- isBrowser = true;
14
- const frameworkNameBe = (''
15
- /* */
16
- /* */
17
- );
18
- const frameworkName = isBrowser ? 'firedev' : frameworkNameBe;
19
- ;
12
+ let isBrowser = false;
13
+ isBrowser = true;
14
+ const frameworkNameBe = (''
15
+ /* */
16
+ /* */
17
+ );
18
+ const frameworkName = isBrowser ? 'firedev' : frameworkNameBe;
19
+ ;
20
20
  ({}); // @--end-of-file-for-module=tnp-core lib/framework-name.ts
21
21
 
22
- function assertPath(path) {
23
- if (typeof path !== 'string') {
24
- throw new TypeError('[firedev-core] Path must be a string. Received ' + JSON.stringify(path));
25
- }
26
- }
27
- function normalizeStringPosix(path, allowAboveRoot) {
28
- var res = '';
29
- var lastSegmentLength = 0;
30
- var lastSlash = -1;
31
- var dots = 0;
32
- var code;
33
- for (var i = 0; i <= path.length; ++i) {
34
- if (i < path.length)
35
- code = path.charCodeAt(i);
36
- else if (code === 47 /*/*/)
37
- break;
38
- else
39
- code = 47 /*/*/;
40
- if (code === 47 /*/*/) {
41
- if (lastSlash === i - 1 || dots === 1) {
42
- }
43
- else if (lastSlash !== i - 1 && dots === 2) {
44
- if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {
45
- if (res.length > 2) {
46
- var lastSlashIndex = res.lastIndexOf('/');
47
- if (lastSlashIndex !== res.length - 1) {
48
- if (lastSlashIndex === -1) {
49
- res = '';
50
- lastSegmentLength = 0;
51
- }
52
- else {
53
- res = res.slice(0, lastSlashIndex);
54
- lastSegmentLength = res.length - 1 - res.lastIndexOf('/');
55
- }
56
- lastSlash = i;
57
- dots = 0;
58
- continue;
59
- }
60
- }
61
- else if (res.length === 2 || res.length === 1) {
62
- res = '';
63
- lastSegmentLength = 0;
64
- lastSlash = i;
65
- dots = 0;
66
- continue;
67
- }
68
- }
69
- if (allowAboveRoot) {
70
- if (res.length > 0)
71
- res += '/..';
72
- else
73
- res = '..';
74
- lastSegmentLength = 2;
75
- }
76
- }
77
- else {
78
- if (res.length > 0)
79
- res += '/' + path.slice(lastSlash + 1, i);
80
- else
81
- res = path.slice(lastSlash + 1, i);
82
- lastSegmentLength = i - lastSlash - 1;
83
- }
84
- lastSlash = i;
85
- dots = 0;
86
- }
87
- else if (code === 46 /*.*/ && dots !== -1) {
88
- ++dots;
89
- }
90
- else {
91
- dots = -1;
92
- }
93
- }
94
- return res;
95
- }
96
- function _format(sep, pathObject) {
97
- var dir = pathObject.dir || pathObject.root;
98
- var base = pathObject.base || (pathObject.name || '') + (pathObject.ext || '');
99
- if (!dir) {
100
- return base;
101
- }
102
- if (dir === pathObject.root) {
103
- return dir + base;
104
- }
105
- return dir + sep + base;
106
- }
107
- const path$1 = {
108
- resolve: function resolve(pathToResovle) {
109
- return pathToResovle;
110
- },
111
- normalize: function normalize(pathArg) {
112
- assertPath(pathArg);
113
- if (pathArg.length === 0)
114
- return '.';
115
- var isAbsolute = pathArg.charCodeAt(0) === 47 /*/*/;
116
- var trailingSeparator = pathArg.charCodeAt(pathArg.length - 1) === 47 /*/*/;
117
- pathArg = normalizeStringPosix(pathArg, !isAbsolute);
118
- if (pathArg.length === 0 && !isAbsolute)
119
- pathArg = '.';
120
- if (pathArg.length > 0 && trailingSeparator)
121
- pathArg += '/';
122
- if (isAbsolute)
123
- return '/' + pathArg;
124
- return pathArg;
125
- },
126
- isAbsolute: function isAbsolute(pathArg) {
127
- assertPath(pathArg);
128
- return pathArg.length > 0 && pathArg.charCodeAt(0) === 47 /*/*/;
129
- },
130
- join: function join() {
131
- if (arguments.length === 0)
132
- return '.';
133
- var joined;
134
- for (var i = 0; i < arguments.length; ++i) {
135
- var arg = arguments[i];
136
- assertPath(arg);
137
- if (arg.length > 0) {
138
- if (joined === undefined)
139
- joined = arg;
140
- else
141
- joined += '/' + arg;
142
- }
143
- }
144
- if (joined === undefined)
145
- return '.';
146
- return path$1.normalize(joined);
147
- },
148
- relative: function relative(from, to) {
149
- assertPath(from);
150
- assertPath(to);
151
- if (from === to)
152
- return '';
153
- from = path$1.resolve(from);
154
- to = path$1.resolve(to);
155
- if (from === to)
156
- return '';
157
- var fromStart = 1;
158
- for (; fromStart < from.length; ++fromStart) {
159
- if (from.charCodeAt(fromStart) !== 47 /*/*/)
160
- break;
161
- }
162
- var fromEnd = from.length;
163
- var fromLen = fromEnd - fromStart;
164
- var toStart = 1;
165
- for (; toStart < to.length; ++toStart) {
166
- if (to.charCodeAt(toStart) !== 47 /*/*/)
167
- break;
168
- }
169
- var toEnd = to.length;
170
- var toLen = toEnd - toStart;
171
- var length = fromLen < toLen ? fromLen : toLen;
172
- var lastCommonSep = -1;
173
- var i = 0;
174
- for (; i <= length; ++i) {
175
- if (i === length) {
176
- if (toLen > length) {
177
- if (to.charCodeAt(toStart + i) === 47 /*/*/) {
178
- return to.slice(toStart + i + 1);
179
- }
180
- else if (i === 0) {
181
- return to.slice(toStart + i);
182
- }
183
- }
184
- else if (fromLen > length) {
185
- if (from.charCodeAt(fromStart + i) === 47 /*/*/) {
186
- lastCommonSep = i;
187
- }
188
- else if (i === 0) {
189
- lastCommonSep = 0;
190
- }
191
- }
192
- break;
193
- }
194
- var fromCode = from.charCodeAt(fromStart + i);
195
- var toCode = to.charCodeAt(toStart + i);
196
- if (fromCode !== toCode)
197
- break;
198
- else if (fromCode === 47 /*/*/)
199
- lastCommonSep = i;
200
- }
201
- var out = '';
202
- for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
203
- if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) {
204
- if (out.length === 0)
205
- out += '..';
206
- else
207
- out += '/..';
208
- }
209
- }
210
- if (out.length > 0)
211
- return out + to.slice(toStart + lastCommonSep);
212
- else {
213
- toStart += lastCommonSep;
214
- if (to.charCodeAt(toStart) === 47 /*/*/)
215
- ++toStart;
216
- return to.slice(toStart);
217
- }
218
- },
219
- _makeLong: function _makeLong(path) {
220
- return path;
221
- },
222
- dirname: function dirname(path) {
223
- assertPath(path);
224
- if (path.length === 0)
225
- return '.';
226
- var code = path.charCodeAt(0);
227
- var hasRoot = code === 47 /*/*/;
228
- var end = -1;
229
- var matchedSlash = true;
230
- for (var i = path.length - 1; i >= 1; --i) {
231
- code = path.charCodeAt(i);
232
- if (code === 47 /*/*/) {
233
- if (!matchedSlash) {
234
- end = i;
235
- break;
236
- }
237
- }
238
- else {
239
- matchedSlash = false;
240
- }
241
- }
242
- if (end === -1)
243
- return hasRoot ? '/' : '.';
244
- if (hasRoot && end === 1)
245
- return '//';
246
- return path.slice(0, end);
247
- },
248
- basename: function basename(pathArg, ext) {
249
- if (ext !== undefined && typeof ext !== 'string')
250
- throw new TypeError('"ext" argument must be a string');
251
- assertPath(pathArg);
252
- var start = 0;
253
- var end = -1;
254
- var matchedSlash = true;
255
- var i;
256
- if (ext !== undefined && ext.length > 0 && ext.length <= pathArg.length) {
257
- if (ext.length === pathArg.length && ext === pathArg)
258
- return '';
259
- var extIdx = ext.length - 1;
260
- var firstNonSlashEnd = -1;
261
- for (i = pathArg.length - 1; i >= 0; --i) {
262
- var code = pathArg.charCodeAt(i);
263
- if (code === 47 /*/*/) {
264
- if (!matchedSlash) {
265
- start = i + 1;
266
- break;
267
- }
268
- }
269
- else {
270
- if (firstNonSlashEnd === -1) {
271
- matchedSlash = false;
272
- firstNonSlashEnd = i + 1;
273
- }
274
- if (extIdx >= 0) {
275
- if (code === ext.charCodeAt(extIdx)) {
276
- if (--extIdx === -1) {
277
- end = i;
278
- }
279
- }
280
- else {
281
- extIdx = -1;
282
- end = firstNonSlashEnd;
283
- }
284
- }
285
- }
286
- }
287
- if (start === end)
288
- end = firstNonSlashEnd;
289
- else if (end === -1)
290
- end = pathArg.length;
291
- return pathArg.slice(start, end);
292
- }
293
- else {
294
- for (i = pathArg.length - 1; i >= 0; --i) {
295
- if (pathArg.charCodeAt(i) === 47 /*/*/) {
296
- if (!matchedSlash) {
297
- start = i + 1;
298
- break;
299
- }
300
- }
301
- else if (end === -1) {
302
- matchedSlash = false;
303
- end = i + 1;
304
- }
305
- }
306
- if (end === -1)
307
- return '';
308
- return pathArg.slice(start, end);
309
- }
310
- },
311
- extname: function extname(pathArg) {
312
- assertPath(pathArg);
313
- var startDot = -1;
314
- var startPart = 0;
315
- var end = -1;
316
- var matchedSlash = true;
317
- var preDotState = 0;
318
- for (var i = pathArg.length - 1; i >= 0; --i) {
319
- var code = pathArg.charCodeAt(i);
320
- if (code === 47 /*/*/) {
321
- if (!matchedSlash) {
322
- startPart = i + 1;
323
- break;
324
- }
325
- continue;
326
- }
327
- if (end === -1) {
328
- matchedSlash = false;
329
- end = i + 1;
330
- }
331
- if (code === 46 /*.*/) {
332
- if (startDot === -1)
333
- startDot = i;
334
- else if (preDotState !== 1)
335
- preDotState = 1;
336
- }
337
- else if (startDot !== -1) {
338
- preDotState = -1;
339
- }
340
- }
341
- if (startDot === -1 || end === -1 ||
342
- preDotState === 0 ||
343
- preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
344
- return '';
345
- }
346
- return pathArg.slice(startDot, end);
347
- },
348
- format: function format(pathObject) {
349
- if (pathObject === null || typeof pathObject !== 'object') {
350
- throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
351
- }
352
- return _format('/', pathObject);
353
- },
354
- parse: function parse(pathArg) {
355
- assertPath(pathArg);
356
- var ret = { root: '', dir: '', base: '', ext: '', name: '' };
357
- if (pathArg.length === 0)
358
- return ret;
359
- var code = pathArg.charCodeAt(0);
360
- var isAbsolute = code === 47 /*/*/;
361
- var start;
362
- if (isAbsolute) {
363
- ret.root = '/';
364
- start = 1;
365
- }
366
- else {
367
- start = 0;
368
- }
369
- var startDot = -1;
370
- var startPart = 0;
371
- var end = -1;
372
- var matchedSlash = true;
373
- var i = pathArg.length - 1;
374
- var preDotState = 0;
375
- for (; i >= start; --i) {
376
- code = pathArg.charCodeAt(i);
377
- if (code === 47 /*/*/) {
378
- if (!matchedSlash) {
379
- startPart = i + 1;
380
- break;
381
- }
382
- continue;
383
- }
384
- if (end === -1) {
385
- matchedSlash = false;
386
- end = i + 1;
387
- }
388
- if (code === 46 /*.*/) {
389
- if (startDot === -1)
390
- startDot = i;
391
- else if (preDotState !== 1)
392
- preDotState = 1;
393
- }
394
- else if (startDot !== -1) {
395
- preDotState = -1;
396
- }
397
- }
398
- if (startDot === -1 || end === -1 ||
399
- preDotState === 0 ||
400
- preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
401
- if (end !== -1) {
402
- if (startPart === 0 && isAbsolute)
403
- ret.base = ret.name = pathArg.slice(1, end);
404
- else
405
- ret.base = ret.name = pathArg.slice(startPart, end);
406
- }
407
- }
408
- else {
409
- if (startPart === 0 && isAbsolute) {
410
- ret.name = pathArg.slice(1, startDot);
411
- ret.base = pathArg.slice(1, end);
412
- }
413
- else {
414
- ret.name = pathArg.slice(startPart, startDot);
415
- ret.base = pathArg.slice(startPart, end);
416
- }
417
- ret.ext = pathArg.slice(startDot, end);
418
- }
419
- if (startPart > 0)
420
- ret.dir = pathArg.slice(0, startPart - 1);
421
- else if (isAbsolute)
422
- ret.dir = '/';
423
- return ret;
424
- },
425
- sep: '/',
426
- delimiter: ':',
427
- win32: {
428
- normalize: (p) => {
429
- return p;
430
- }
431
- },
432
- posix: null
433
- };
434
- ;
22
+ function assertPath(path) {
23
+ if (typeof path !== 'string') {
24
+ throw new TypeError('[firedev-core] Path must be a string. Received ' + JSON.stringify(path));
25
+ }
26
+ }
27
+ function normalizeStringPosix(path, allowAboveRoot) {
28
+ var res = '';
29
+ var lastSegmentLength = 0;
30
+ var lastSlash = -1;
31
+ var dots = 0;
32
+ var code;
33
+ for (var i = 0; i <= path.length; ++i) {
34
+ if (i < path.length)
35
+ code = path.charCodeAt(i);
36
+ else if (code === 47 /*/*/)
37
+ break;
38
+ else
39
+ code = 47 /*/*/;
40
+ if (code === 47 /*/*/) {
41
+ if (lastSlash === i - 1 || dots === 1) {
42
+ }
43
+ else if (lastSlash !== i - 1 && dots === 2) {
44
+ if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {
45
+ if (res.length > 2) {
46
+ var lastSlashIndex = res.lastIndexOf('/');
47
+ if (lastSlashIndex !== res.length - 1) {
48
+ if (lastSlashIndex === -1) {
49
+ res = '';
50
+ lastSegmentLength = 0;
51
+ }
52
+ else {
53
+ res = res.slice(0, lastSlashIndex);
54
+ lastSegmentLength = res.length - 1 - res.lastIndexOf('/');
55
+ }
56
+ lastSlash = i;
57
+ dots = 0;
58
+ continue;
59
+ }
60
+ }
61
+ else if (res.length === 2 || res.length === 1) {
62
+ res = '';
63
+ lastSegmentLength = 0;
64
+ lastSlash = i;
65
+ dots = 0;
66
+ continue;
67
+ }
68
+ }
69
+ if (allowAboveRoot) {
70
+ if (res.length > 0)
71
+ res += '/..';
72
+ else
73
+ res = '..';
74
+ lastSegmentLength = 2;
75
+ }
76
+ }
77
+ else {
78
+ if (res.length > 0)
79
+ res += '/' + path.slice(lastSlash + 1, i);
80
+ else
81
+ res = path.slice(lastSlash + 1, i);
82
+ lastSegmentLength = i - lastSlash - 1;
83
+ }
84
+ lastSlash = i;
85
+ dots = 0;
86
+ }
87
+ else if (code === 46 /*.*/ && dots !== -1) {
88
+ ++dots;
89
+ }
90
+ else {
91
+ dots = -1;
92
+ }
93
+ }
94
+ return res;
95
+ }
96
+ function _format(sep, pathObject) {
97
+ var dir = pathObject.dir || pathObject.root;
98
+ var base = pathObject.base || (pathObject.name || '') + (pathObject.ext || '');
99
+ if (!dir) {
100
+ return base;
101
+ }
102
+ if (dir === pathObject.root) {
103
+ return dir + base;
104
+ }
105
+ return dir + sep + base;
106
+ }
107
+ const path$1 = {
108
+ resolve: function resolve(pathToResovle) {
109
+ return pathToResovle;
110
+ },
111
+ normalize: function normalize(pathArg) {
112
+ assertPath(pathArg);
113
+ if (pathArg.length === 0)
114
+ return '.';
115
+ var isAbsolute = pathArg.charCodeAt(0) === 47 /*/*/;
116
+ var trailingSeparator = pathArg.charCodeAt(pathArg.length - 1) === 47 /*/*/;
117
+ pathArg = normalizeStringPosix(pathArg, !isAbsolute);
118
+ if (pathArg.length === 0 && !isAbsolute)
119
+ pathArg = '.';
120
+ if (pathArg.length > 0 && trailingSeparator)
121
+ pathArg += '/';
122
+ if (isAbsolute)
123
+ return '/' + pathArg;
124
+ return pathArg;
125
+ },
126
+ isAbsolute: function isAbsolute(pathArg) {
127
+ assertPath(pathArg);
128
+ return pathArg.length > 0 && pathArg.charCodeAt(0) === 47 /*/*/;
129
+ },
130
+ join: function join() {
131
+ if (arguments.length === 0)
132
+ return '.';
133
+ var joined;
134
+ for (var i = 0; i < arguments.length; ++i) {
135
+ var arg = arguments[i];
136
+ assertPath(arg);
137
+ if (arg.length > 0) {
138
+ if (joined === undefined)
139
+ joined = arg;
140
+ else
141
+ joined += '/' + arg;
142
+ }
143
+ }
144
+ if (joined === undefined)
145
+ return '.';
146
+ return path$1.normalize(joined);
147
+ },
148
+ relative: function relative(from, to) {
149
+ assertPath(from);
150
+ assertPath(to);
151
+ if (from === to)
152
+ return '';
153
+ from = path$1.resolve(from);
154
+ to = path$1.resolve(to);
155
+ if (from === to)
156
+ return '';
157
+ var fromStart = 1;
158
+ for (; fromStart < from.length; ++fromStart) {
159
+ if (from.charCodeAt(fromStart) !== 47 /*/*/)
160
+ break;
161
+ }
162
+ var fromEnd = from.length;
163
+ var fromLen = fromEnd - fromStart;
164
+ var toStart = 1;
165
+ for (; toStart < to.length; ++toStart) {
166
+ if (to.charCodeAt(toStart) !== 47 /*/*/)
167
+ break;
168
+ }
169
+ var toEnd = to.length;
170
+ var toLen = toEnd - toStart;
171
+ var length = fromLen < toLen ? fromLen : toLen;
172
+ var lastCommonSep = -1;
173
+ var i = 0;
174
+ for (; i <= length; ++i) {
175
+ if (i === length) {
176
+ if (toLen > length) {
177
+ if (to.charCodeAt(toStart + i) === 47 /*/*/) {
178
+ return to.slice(toStart + i + 1);
179
+ }
180
+ else if (i === 0) {
181
+ return to.slice(toStart + i);
182
+ }
183
+ }
184
+ else if (fromLen > length) {
185
+ if (from.charCodeAt(fromStart + i) === 47 /*/*/) {
186
+ lastCommonSep = i;
187
+ }
188
+ else if (i === 0) {
189
+ lastCommonSep = 0;
190
+ }
191
+ }
192
+ break;
193
+ }
194
+ var fromCode = from.charCodeAt(fromStart + i);
195
+ var toCode = to.charCodeAt(toStart + i);
196
+ if (fromCode !== toCode)
197
+ break;
198
+ else if (fromCode === 47 /*/*/)
199
+ lastCommonSep = i;
200
+ }
201
+ var out = '';
202
+ for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
203
+ if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) {
204
+ if (out.length === 0)
205
+ out += '..';
206
+ else
207
+ out += '/..';
208
+ }
209
+ }
210
+ if (out.length > 0)
211
+ return out + to.slice(toStart + lastCommonSep);
212
+ else {
213
+ toStart += lastCommonSep;
214
+ if (to.charCodeAt(toStart) === 47 /*/*/)
215
+ ++toStart;
216
+ return to.slice(toStart);
217
+ }
218
+ },
219
+ _makeLong: function _makeLong(path) {
220
+ return path;
221
+ },
222
+ dirname: function dirname(path) {
223
+ assertPath(path);
224
+ if (path.length === 0)
225
+ return '.';
226
+ var code = path.charCodeAt(0);
227
+ var hasRoot = code === 47 /*/*/;
228
+ var end = -1;
229
+ var matchedSlash = true;
230
+ for (var i = path.length - 1; i >= 1; --i) {
231
+ code = path.charCodeAt(i);
232
+ if (code === 47 /*/*/) {
233
+ if (!matchedSlash) {
234
+ end = i;
235
+ break;
236
+ }
237
+ }
238
+ else {
239
+ matchedSlash = false;
240
+ }
241
+ }
242
+ if (end === -1)
243
+ return hasRoot ? '/' : '.';
244
+ if (hasRoot && end === 1)
245
+ return '//';
246
+ return path.slice(0, end);
247
+ },
248
+ basename: function basename(pathArg, ext) {
249
+ if (ext !== undefined && typeof ext !== 'string')
250
+ throw new TypeError('"ext" argument must be a string');
251
+ assertPath(pathArg);
252
+ var start = 0;
253
+ var end = -1;
254
+ var matchedSlash = true;
255
+ var i;
256
+ if (ext !== undefined && ext.length > 0 && ext.length <= pathArg.length) {
257
+ if (ext.length === pathArg.length && ext === pathArg)
258
+ return '';
259
+ var extIdx = ext.length - 1;
260
+ var firstNonSlashEnd = -1;
261
+ for (i = pathArg.length - 1; i >= 0; --i) {
262
+ var code = pathArg.charCodeAt(i);
263
+ if (code === 47 /*/*/) {
264
+ if (!matchedSlash) {
265
+ start = i + 1;
266
+ break;
267
+ }
268
+ }
269
+ else {
270
+ if (firstNonSlashEnd === -1) {
271
+ matchedSlash = false;
272
+ firstNonSlashEnd = i + 1;
273
+ }
274
+ if (extIdx >= 0) {
275
+ if (code === ext.charCodeAt(extIdx)) {
276
+ if (--extIdx === -1) {
277
+ end = i;
278
+ }
279
+ }
280
+ else {
281
+ extIdx = -1;
282
+ end = firstNonSlashEnd;
283
+ }
284
+ }
285
+ }
286
+ }
287
+ if (start === end)
288
+ end = firstNonSlashEnd;
289
+ else if (end === -1)
290
+ end = pathArg.length;
291
+ return pathArg.slice(start, end);
292
+ }
293
+ else {
294
+ for (i = pathArg.length - 1; i >= 0; --i) {
295
+ if (pathArg.charCodeAt(i) === 47 /*/*/) {
296
+ if (!matchedSlash) {
297
+ start = i + 1;
298
+ break;
299
+ }
300
+ }
301
+ else if (end === -1) {
302
+ matchedSlash = false;
303
+ end = i + 1;
304
+ }
305
+ }
306
+ if (end === -1)
307
+ return '';
308
+ return pathArg.slice(start, end);
309
+ }
310
+ },
311
+ extname: function extname(pathArg) {
312
+ assertPath(pathArg);
313
+ var startDot = -1;
314
+ var startPart = 0;
315
+ var end = -1;
316
+ var matchedSlash = true;
317
+ var preDotState = 0;
318
+ for (var i = pathArg.length - 1; i >= 0; --i) {
319
+ var code = pathArg.charCodeAt(i);
320
+ if (code === 47 /*/*/) {
321
+ if (!matchedSlash) {
322
+ startPart = i + 1;
323
+ break;
324
+ }
325
+ continue;
326
+ }
327
+ if (end === -1) {
328
+ matchedSlash = false;
329
+ end = i + 1;
330
+ }
331
+ if (code === 46 /*.*/) {
332
+ if (startDot === -1)
333
+ startDot = i;
334
+ else if (preDotState !== 1)
335
+ preDotState = 1;
336
+ }
337
+ else if (startDot !== -1) {
338
+ preDotState = -1;
339
+ }
340
+ }
341
+ if (startDot === -1 || end === -1 ||
342
+ preDotState === 0 ||
343
+ preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
344
+ return '';
345
+ }
346
+ return pathArg.slice(startDot, end);
347
+ },
348
+ format: function format(pathObject) {
349
+ if (pathObject === null || typeof pathObject !== 'object') {
350
+ throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
351
+ }
352
+ return _format('/', pathObject);
353
+ },
354
+ parse: function parse(pathArg) {
355
+ assertPath(pathArg);
356
+ var ret = { root: '', dir: '', base: '', ext: '', name: '' };
357
+ if (pathArg.length === 0)
358
+ return ret;
359
+ var code = pathArg.charCodeAt(0);
360
+ var isAbsolute = code === 47 /*/*/;
361
+ var start;
362
+ if (isAbsolute) {
363
+ ret.root = '/';
364
+ start = 1;
365
+ }
366
+ else {
367
+ start = 0;
368
+ }
369
+ var startDot = -1;
370
+ var startPart = 0;
371
+ var end = -1;
372
+ var matchedSlash = true;
373
+ var i = pathArg.length - 1;
374
+ var preDotState = 0;
375
+ for (; i >= start; --i) {
376
+ code = pathArg.charCodeAt(i);
377
+ if (code === 47 /*/*/) {
378
+ if (!matchedSlash) {
379
+ startPart = i + 1;
380
+ break;
381
+ }
382
+ continue;
383
+ }
384
+ if (end === -1) {
385
+ matchedSlash = false;
386
+ end = i + 1;
387
+ }
388
+ if (code === 46 /*.*/) {
389
+ if (startDot === -1)
390
+ startDot = i;
391
+ else if (preDotState !== 1)
392
+ preDotState = 1;
393
+ }
394
+ else if (startDot !== -1) {
395
+ preDotState = -1;
396
+ }
397
+ }
398
+ if (startDot === -1 || end === -1 ||
399
+ preDotState === 0 ||
400
+ preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
401
+ if (end !== -1) {
402
+ if (startPart === 0 && isAbsolute)
403
+ ret.base = ret.name = pathArg.slice(1, end);
404
+ else
405
+ ret.base = ret.name = pathArg.slice(startPart, end);
406
+ }
407
+ }
408
+ else {
409
+ if (startPart === 0 && isAbsolute) {
410
+ ret.name = pathArg.slice(1, startDot);
411
+ ret.base = pathArg.slice(1, end);
412
+ }
413
+ else {
414
+ ret.name = pathArg.slice(startPart, startDot);
415
+ ret.base = pathArg.slice(startPart, end);
416
+ }
417
+ ret.ext = pathArg.slice(startDot, end);
418
+ }
419
+ if (startPart > 0)
420
+ ret.dir = pathArg.slice(0, startPart - 1);
421
+ else if (isAbsolute)
422
+ ret.dir = '/';
423
+ return ret;
424
+ },
425
+ sep: '/',
426
+ delimiter: ':',
427
+ win32: {
428
+ normalize: (p) => {
429
+ return p;
430
+ }
431
+ },
432
+ posix: null
433
+ };
434
+ ;
435
435
  ({}); // @--end-of-file-for-module=tnp-core lib/node-path-mock.ts
436
436
 
437
- let path;
438
- /* */
439
- /* */
440
- // @ts-ignore
441
- path = path$1;
442
- function win32Path(p) {
443
- /* */
444
- /* */
445
- /* */
446
- /* */
447
- if (/^\/[a-z]\//.test(p)) {
448
- p = p.replace(/^\/[a-z]\//, `${p.charAt(1).toUpperCase()}:/`);
449
- }
450
- return path.win32.normalize(p);
451
- }
452
- function crossPlatformPath(pathStringOrPathParts) {
453
- if (Array.isArray(pathStringOrPathParts)) {
454
- pathStringOrPathParts = pathStringOrPathParts.join('/');
455
- }
456
- /* */
457
- /* */
458
- /* */
459
- /* */
460
- if (typeof pathStringOrPathParts !== 'string') {
461
- return pathStringOrPathParts;
462
- }
463
- const isExtendedLengthPath = /^\\\\\?\\/.test(pathStringOrPathParts);
464
- const hasNonAscii = /[^\u0000-\u0080]+/.test(pathStringOrPathParts); // eslint-disable-line no-control-regex
465
- if (isExtendedLengthPath || hasNonAscii) {
466
- return pathStringOrPathParts;
467
- }
468
- return pathStringOrPathParts.replace(/\\/g, '/');
469
- }
437
+ let path;
438
+ /* */
439
+ /* */
440
+ // @ts-ignore
441
+ path = path$1;
442
+ function win32Path(p) {
443
+ /* */
444
+ /* */
445
+ /* */
446
+ /* */
447
+ if (/^\/[a-z]\//.test(p)) {
448
+ p = p.replace(/^\/[a-z]\//, `${p.charAt(1).toUpperCase()}:/`);
449
+ }
450
+ return path.win32.normalize(p);
451
+ }
452
+ function crossPlatformPath(pathStringOrPathParts) {
453
+ if (Array.isArray(pathStringOrPathParts)) {
454
+ pathStringOrPathParts = pathStringOrPathParts.join('/');
455
+ }
456
+ /* */
457
+ /* */
458
+ /* */
459
+ /* */
460
+ if (typeof pathStringOrPathParts !== 'string') {
461
+ return pathStringOrPathParts;
462
+ }
463
+ const isExtendedLengthPath = /^\\\\\?\\/.test(pathStringOrPathParts);
464
+ const hasNonAscii = /[^\u0000-\u0080]+/.test(pathStringOrPathParts); // eslint-disable-line no-control-regex
465
+ if (isExtendedLengthPath || hasNonAscii) {
466
+ return pathStringOrPathParts;
467
+ }
468
+ return pathStringOrPathParts.replace(/\\/g, '/');
469
+ }
470
470
  ({}); // @--end-of-file-for-module=tnp-core lib/core-imports.ts
471
471
 
472
- ;
472
+ ;
473
473
  ({}); // @--end-of-file-for-module=tnp-core lib/core-models.ts
474
474
 
475
- class HelpersIsomorphic {
476
- get isBrowser() {
477
- /* */
478
- /* */
479
- return true;
480
- }
481
- get isWebSQL() {
482
- /* */
483
- /* */
484
- return true;
485
- return false;
486
- }
487
- get isNode() {
488
- /* */
489
- /* */
490
- return false;
491
- }
492
- contain(arr, item) {
493
- return arr.filter(l => {
494
- if (l instanceof RegExp) {
495
- return l.test(item);
496
- }
497
- if (l === item) {
498
- return true;
499
- }
500
- if ((item.match && typeof item.match === 'function') ? item.match(l) : false) {
501
- return true;
502
- }
503
- return false;
504
- }).length > 0;
505
- }
506
- }
507
- ;
475
+ class HelpersIsomorphic {
476
+ get isBrowser() {
477
+ /* */
478
+ /* */
479
+ return true;
480
+ }
481
+ get isWebSQL() {
482
+ /* */
483
+ /* */
484
+ return true;
485
+ return false;
486
+ }
487
+ get isNode() {
488
+ /* */
489
+ /* */
490
+ return false;
491
+ }
492
+ contain(arr, item) {
493
+ return arr.filter(l => {
494
+ if (l instanceof RegExp) {
495
+ return l.test(item);
496
+ }
497
+ if (l === item) {
498
+ return true;
499
+ }
500
+ if ((item.match && typeof item.match === 'function') ? item.match(l) : false) {
501
+ return true;
502
+ }
503
+ return false;
504
+ }).length > 0;
505
+ }
506
+ }
507
+ ;
508
508
  ({}); // @--end-of-file-for-module=tnp-core lib/helpers-isomorphic.ts
509
509
 
510
- /* */
511
- const KEY = {
512
- LAST_ERROR: Symbol(),
513
- LAST_INFO: Symbol(),
514
- LAST_WARN: Symbol(),
515
- LAST_LOG: Symbol(),
516
- LAST_SUCCESS: Symbol(),
517
- LAST_TASK_STARTED: Symbol(),
518
- LAST_TASK_DONE: Symbol(),
519
- };
520
- const KEY_COUNT = {
521
- LAST_ERROR: Symbol(),
522
- LAST_INFO: Symbol(),
523
- LAST_WARN: Symbol(),
524
- LAST_LOG: Symbol(),
525
- LAST_SUCCESS: Symbol(),
526
- LAST_TASK_STARTED: Symbol(),
527
- LAST_TASK_DONE: Symbol(),
528
- };
529
- const KEY_IMPORTANTCE = {
530
- LAST_ERROR: Symbol(),
531
- LAST_INFO: Symbol(),
532
- LAST_WARN: Symbol(),
533
- LAST_LOG: Symbol(),
534
- LAST_SUCCESS: Symbol(),
535
- LAST_TASK_STARTED: Symbol(),
536
- LAST_TASK_DONE: Symbol(),
537
- };
538
- /* */
539
- /* */
540
- /* */
541
- /* */
542
- /* */
543
- /* */
544
- /* */
545
- /* */
546
- /* */
547
- /* */
548
- /* */
549
- /* */
550
- /* */
551
- /* */
552
- /* */
553
- /* */
554
- /* */
555
- /* */
556
- /* */
557
- /* */
558
- /* */
559
- /* */
560
- const LIMIT = 10;
561
- class HelpersMessages extends HelpersIsomorphic {
562
- msgCacheClear() {
563
- /* */
564
- /* */
565
- /* */
566
- /* */
567
- /* */
568
- }
569
- error(details, noExit = false, noTrace = false) {
570
- if (Helpers.isBrowser) {
571
- console.error(details);
572
- return;
573
- }
574
- /* */
575
- /* */
576
- /* */
577
- /* */
578
- /* */
579
- /* */
580
- /* */
581
- /* */
582
- /* */
583
- /* */
584
- /* */
585
- /* */
586
- /* */
587
- /* */
588
- /* */
589
- /* */
590
- /* */
591
- /* */
592
- /* */
593
- /* */
594
- /* */
595
- /* */
596
- /* */
597
- /* */
598
- /* */
599
- /* */
600
- /* */
601
- /* */
602
- /* */
603
- /* */
604
- /* */
605
- /* */
606
- /* */
607
- /* */
608
- /* */
609
- /* */
610
- /* */
611
- /* */
612
- /* */
613
- /* */
614
- /* */
615
- /* */
616
- /* */
617
- /* */
618
- /* */
619
- /* */
620
- /* */
621
- /* */
622
- /* */
623
- /* */
624
- /* */
625
- }
626
- info(details, repeatable = false) {
627
- /* */
628
- /* */
629
- /* */
630
- /* */
631
- /* */
632
- /* */
633
- if (Helpers.isBrowser) {
634
- console.info(details);
635
- return;
636
- }
637
- /* */
638
- /* */
639
- /* */
640
- /* */
641
- /* */
642
- /* */
643
- /* */
644
- /* */
645
- /* */
646
- /* */
647
- /* */
648
- /* */
649
- /* */
650
- /* */
651
- /* */
652
- /* */
653
- /* */
654
- /* */
655
- /* */
656
- /* */
657
- /* */
658
- /* */
659
- /* */
660
- /* */
661
- /* */
662
- /* */
663
- /* */
664
- /* */
665
- /* */
666
- /* */
667
- /* */
668
- /* */
669
- /* */
670
- /* */
671
- /* */
672
- }
673
- success(details) {
674
- if (Helpers.isBrowser) {
675
- console.info(details);
676
- return;
677
- }
678
- /* */
679
- /* */
680
- /* */
681
- /* */
682
- /* */
683
- /* */
684
- /* */
685
- /* */
686
- /* */
687
- /* */
688
- /* */
689
- /* */
690
- /* */
691
- /* */
692
- /* */
693
- /* */
694
- /* */
695
- /* */
696
- /* */
697
- /* */
698
- /* */
699
- /* */
700
- /* */
701
- /* */
702
- /* */
703
- /* */
704
- /* */
705
- /* */
706
- /* */
707
- /* */
708
- /* */
709
- /* */
710
- /* */
711
- /* */
712
- /* */
713
- /* */
714
- /* */
715
- /* */
716
- }
717
- /**
718
- *
719
- * @param details
720
- * @param isLogTask is less important log task
721
- * @returns
722
- */
723
- taskStarted(details, isLogTask = false) {
724
- if (Helpers.isBrowser) {
725
- console.info(details);
726
- return;
727
- }
728
- /* */
729
- /* */
730
- /* */
731
- /* */
732
- /* */
733
- /* */
734
- /* */
735
- /* */
736
- /* */
737
- /* */
738
- /* */
739
- /* */
740
- /* */
741
- /* */
742
- /* */
743
- /* */
744
- /* */
745
- /* */
746
- /* */
747
- /* */
748
- /* */
749
- /* */
750
- /* */
751
- /* */
752
- /* */
753
- /* */
754
- /* */
755
- /* */
756
- /* */
757
- /* */
758
- /* */
759
- /* */
760
- /* */
761
- /* */
762
- /* */
763
- /* */
764
- /* */
765
- /* */
766
- /* */
767
- /* */
768
- /* */
769
- /* */
770
- /* */
771
- /* */
772
- /* */
773
- /* */
774
- }
775
- taskDone(details, isLessImportant = false) {
776
- if (Helpers.isBrowser) {
777
- console.info(details);
778
- return;
779
- }
780
- /* */
781
- /* */
782
- /* */
783
- /* */
784
- /* */
785
- /* */
786
- /* */
787
- /* */
788
- /* */
789
- /* */
790
- /* */
791
- /* */
792
- /* */
793
- /* */
794
- /* */
795
- /* */
796
- /* */
797
- /* */
798
- /* */
799
- /* */
800
- /* */
801
- /* */
802
- /* */
803
- /* */
804
- /* */
805
- /* */
806
- /* */
807
- /* */
808
- /* */
809
- /* */
810
- /* */
811
- /* */
812
- /* */
813
- /* */
814
- /* */
815
- /* */
816
- /* */
817
- /* */
818
- /* */
819
- /* */
820
- /* */
821
- /* */
822
- /* */
823
- /* */
824
- /* */
825
- /* */
826
- /* */
827
- /* */
828
- }
829
- log(details, debugLevel = 0) {
830
- if (Helpers.isBrowser) {
831
- console.log(details);
832
- return;
833
- }
834
- /* */
835
- /* */
836
- /* */
837
- /* */
838
- /* */
839
- /* */
840
- /* */
841
- /* */
842
- /* */
843
- /* */
844
- /* */
845
- /* */
846
- /* */
847
- /* */
848
- /* */
849
- /* */
850
- /* */
851
- /* */
852
- /* */
853
- /* */
854
- /* */
855
- /* */
856
- /* */
857
- /* */
858
- /* */
859
- /* */
860
- /* */
861
- /* */
862
- /* */
863
- /* */
864
- /* */
865
- /* */
866
- /* */
867
- /* */
868
- /* */
869
- /* */
870
- /* */
871
- /* */
872
- /* */
873
- /* */
874
- /* */
875
- /* */
876
- /* */
877
- /* */
878
- /* */
879
- /* */
880
- /* */
881
- /* */
882
- /* */
883
- /* */
884
- /* */
885
- /* */
886
- /* */
887
- /* */
888
- }
889
- /* */
890
- /* */
891
- /* */
892
- /* */
893
- /* */
894
- /* */
895
- /* */
896
- /* */
897
- /* */
898
- /* */
899
- /* */
900
- /* */
901
- /* */
902
- /* */
903
- /* */
904
- /* */
905
- /* */
906
- /* */
907
- /* */
908
- /* */
909
- /* */
910
- /* */
911
- /* */
912
- /* */
913
- /* */
914
- /* */
915
- /* */
916
- /* */
917
- /* */
918
- /* */
919
- /* */
920
- /* */
921
- /* */
922
- /* */
923
- /* */
924
- /* */
925
- /* */
926
- /* */
927
- /* */
928
- /* */
929
- warn(details, trace = false) {
930
- if (Helpers.isBrowser) {
931
- console.warn(details);
932
- return;
933
- }
934
- /* */
935
- /* */
936
- /* */
937
- /* */
938
- /* */
939
- /* */
940
- /* */
941
- /* */
942
- /* */
943
- /* */
944
- /* */
945
- /* */
946
- /* */
947
- /* */
948
- /* */
949
- /* */
950
- /* */
951
- /* */
952
- /* */
953
- /* */
954
- /* */
955
- /* */
956
- /* */
957
- /* */
958
- /* */
959
- /* */
960
- /* */
961
- /* */
962
- /* */
963
- /* */
964
- /* */
965
- /* */
966
- /* */
967
- /* */
968
- /* */
969
- /* */
970
- /* */
971
- /* */
972
- /* */
973
- /* */
974
- /* */
975
- /* */
976
- /* */
977
- /* */
978
- /* */
979
- /* */
980
- }
981
- }
982
- function transformData(details) {
983
- if (typeof details === 'object') {
984
- if (Array.isArray(details)) {
985
- return details.join('\n');
986
- }
987
- try {
988
- const json = JSON.stringify(details);
989
- details = json;
990
- }
991
- catch (error) {
992
- return details;
993
- }
994
- }
995
- return details;
996
- }
997
- ;
510
+ /* */
511
+ const KEY = {
512
+ LAST_ERROR: Symbol(),
513
+ LAST_INFO: Symbol(),
514
+ LAST_WARN: Symbol(),
515
+ LAST_LOG: Symbol(),
516
+ LAST_SUCCESS: Symbol(),
517
+ LAST_TASK_STARTED: Symbol(),
518
+ LAST_TASK_DONE: Symbol(),
519
+ };
520
+ const KEY_COUNT = {
521
+ LAST_ERROR: Symbol(),
522
+ LAST_INFO: Symbol(),
523
+ LAST_WARN: Symbol(),
524
+ LAST_LOG: Symbol(),
525
+ LAST_SUCCESS: Symbol(),
526
+ LAST_TASK_STARTED: Symbol(),
527
+ LAST_TASK_DONE: Symbol(),
528
+ };
529
+ const KEY_IMPORTANTCE = {
530
+ LAST_ERROR: Symbol(),
531
+ LAST_INFO: Symbol(),
532
+ LAST_WARN: Symbol(),
533
+ LAST_LOG: Symbol(),
534
+ LAST_SUCCESS: Symbol(),
535
+ LAST_TASK_STARTED: Symbol(),
536
+ LAST_TASK_DONE: Symbol(),
537
+ };
538
+ /* */
539
+ /* */
540
+ /* */
541
+ /* */
542
+ /* */
543
+ /* */
544
+ /* */
545
+ /* */
546
+ /* */
547
+ /* */
548
+ /* */
549
+ /* */
550
+ /* */
551
+ /* */
552
+ /* */
553
+ /* */
554
+ /* */
555
+ /* */
556
+ /* */
557
+ /* */
558
+ /* */
559
+ /* */
560
+ const LIMIT = 10;
561
+ class HelpersMessages extends HelpersIsomorphic {
562
+ msgCacheClear() {
563
+ /* */
564
+ /* */
565
+ /* */
566
+ /* */
567
+ /* */
568
+ }
569
+ error(details, noExit = false, noTrace = false) {
570
+ if (Helpers.isBrowser) {
571
+ console.error(details);
572
+ return;
573
+ }
574
+ /* */
575
+ /* */
576
+ /* */
577
+ /* */
578
+ /* */
579
+ /* */
580
+ /* */
581
+ /* */
582
+ /* */
583
+ /* */
584
+ /* */
585
+ /* */
586
+ /* */
587
+ /* */
588
+ /* */
589
+ /* */
590
+ /* */
591
+ /* */
592
+ /* */
593
+ /* */
594
+ /* */
595
+ /* */
596
+ /* */
597
+ /* */
598
+ /* */
599
+ /* */
600
+ /* */
601
+ /* */
602
+ /* */
603
+ /* */
604
+ /* */
605
+ /* */
606
+ /* */
607
+ /* */
608
+ /* */
609
+ /* */
610
+ /* */
611
+ /* */
612
+ /* */
613
+ /* */
614
+ /* */
615
+ /* */
616
+ /* */
617
+ /* */
618
+ /* */
619
+ /* */
620
+ /* */
621
+ /* */
622
+ /* */
623
+ /* */
624
+ /* */
625
+ }
626
+ info(details, repeatable = false) {
627
+ /* */
628
+ /* */
629
+ /* */
630
+ /* */
631
+ /* */
632
+ /* */
633
+ if (Helpers.isBrowser) {
634
+ console.info(details);
635
+ return;
636
+ }
637
+ /* */
638
+ /* */
639
+ /* */
640
+ /* */
641
+ /* */
642
+ /* */
643
+ /* */
644
+ /* */
645
+ /* */
646
+ /* */
647
+ /* */
648
+ /* */
649
+ /* */
650
+ /* */
651
+ /* */
652
+ /* */
653
+ /* */
654
+ /* */
655
+ /* */
656
+ /* */
657
+ /* */
658
+ /* */
659
+ /* */
660
+ /* */
661
+ /* */
662
+ /* */
663
+ /* */
664
+ /* */
665
+ /* */
666
+ /* */
667
+ /* */
668
+ /* */
669
+ /* */
670
+ /* */
671
+ /* */
672
+ }
673
+ success(details) {
674
+ if (Helpers.isBrowser) {
675
+ console.info(details);
676
+ return;
677
+ }
678
+ /* */
679
+ /* */
680
+ /* */
681
+ /* */
682
+ /* */
683
+ /* */
684
+ /* */
685
+ /* */
686
+ /* */
687
+ /* */
688
+ /* */
689
+ /* */
690
+ /* */
691
+ /* */
692
+ /* */
693
+ /* */
694
+ /* */
695
+ /* */
696
+ /* */
697
+ /* */
698
+ /* */
699
+ /* */
700
+ /* */
701
+ /* */
702
+ /* */
703
+ /* */
704
+ /* */
705
+ /* */
706
+ /* */
707
+ /* */
708
+ /* */
709
+ /* */
710
+ /* */
711
+ /* */
712
+ /* */
713
+ /* */
714
+ /* */
715
+ /* */
716
+ }
717
+ /**
718
+ *
719
+ * @param details
720
+ * @param isLogTask is less important log task
721
+ * @returns
722
+ */
723
+ taskStarted(details, isLogTask = false) {
724
+ if (Helpers.isBrowser) {
725
+ console.info(details);
726
+ return;
727
+ }
728
+ /* */
729
+ /* */
730
+ /* */
731
+ /* */
732
+ /* */
733
+ /* */
734
+ /* */
735
+ /* */
736
+ /* */
737
+ /* */
738
+ /* */
739
+ /* */
740
+ /* */
741
+ /* */
742
+ /* */
743
+ /* */
744
+ /* */
745
+ /* */
746
+ /* */
747
+ /* */
748
+ /* */
749
+ /* */
750
+ /* */
751
+ /* */
752
+ /* */
753
+ /* */
754
+ /* */
755
+ /* */
756
+ /* */
757
+ /* */
758
+ /* */
759
+ /* */
760
+ /* */
761
+ /* */
762
+ /* */
763
+ /* */
764
+ /* */
765
+ /* */
766
+ /* */
767
+ /* */
768
+ /* */
769
+ /* */
770
+ /* */
771
+ /* */
772
+ /* */
773
+ /* */
774
+ }
775
+ taskDone(details, isLessImportant = false) {
776
+ if (Helpers.isBrowser) {
777
+ console.info(details);
778
+ return;
779
+ }
780
+ /* */
781
+ /* */
782
+ /* */
783
+ /* */
784
+ /* */
785
+ /* */
786
+ /* */
787
+ /* */
788
+ /* */
789
+ /* */
790
+ /* */
791
+ /* */
792
+ /* */
793
+ /* */
794
+ /* */
795
+ /* */
796
+ /* */
797
+ /* */
798
+ /* */
799
+ /* */
800
+ /* */
801
+ /* */
802
+ /* */
803
+ /* */
804
+ /* */
805
+ /* */
806
+ /* */
807
+ /* */
808
+ /* */
809
+ /* */
810
+ /* */
811
+ /* */
812
+ /* */
813
+ /* */
814
+ /* */
815
+ /* */
816
+ /* */
817
+ /* */
818
+ /* */
819
+ /* */
820
+ /* */
821
+ /* */
822
+ /* */
823
+ /* */
824
+ /* */
825
+ /* */
826
+ /* */
827
+ /* */
828
+ }
829
+ log(details, debugLevel = 0) {
830
+ if (Helpers.isBrowser) {
831
+ console.log(details);
832
+ return;
833
+ }
834
+ /* */
835
+ /* */
836
+ /* */
837
+ /* */
838
+ /* */
839
+ /* */
840
+ /* */
841
+ /* */
842
+ /* */
843
+ /* */
844
+ /* */
845
+ /* */
846
+ /* */
847
+ /* */
848
+ /* */
849
+ /* */
850
+ /* */
851
+ /* */
852
+ /* */
853
+ /* */
854
+ /* */
855
+ /* */
856
+ /* */
857
+ /* */
858
+ /* */
859
+ /* */
860
+ /* */
861
+ /* */
862
+ /* */
863
+ /* */
864
+ /* */
865
+ /* */
866
+ /* */
867
+ /* */
868
+ /* */
869
+ /* */
870
+ /* */
871
+ /* */
872
+ /* */
873
+ /* */
874
+ /* */
875
+ /* */
876
+ /* */
877
+ /* */
878
+ /* */
879
+ /* */
880
+ /* */
881
+ /* */
882
+ /* */
883
+ /* */
884
+ /* */
885
+ /* */
886
+ /* */
887
+ /* */
888
+ }
889
+ /* */
890
+ /* */
891
+ /* */
892
+ /* */
893
+ /* */
894
+ /* */
895
+ /* */
896
+ /* */
897
+ /* */
898
+ /* */
899
+ /* */
900
+ /* */
901
+ /* */
902
+ /* */
903
+ /* */
904
+ /* */
905
+ /* */
906
+ /* */
907
+ /* */
908
+ /* */
909
+ /* */
910
+ /* */
911
+ /* */
912
+ /* */
913
+ /* */
914
+ /* */
915
+ /* */
916
+ /* */
917
+ /* */
918
+ /* */
919
+ /* */
920
+ /* */
921
+ /* */
922
+ /* */
923
+ /* */
924
+ /* */
925
+ /* */
926
+ /* */
927
+ /* */
928
+ /* */
929
+ warn(details, trace = false) {
930
+ if (Helpers.isBrowser) {
931
+ console.warn(details);
932
+ return;
933
+ }
934
+ /* */
935
+ /* */
936
+ /* */
937
+ /* */
938
+ /* */
939
+ /* */
940
+ /* */
941
+ /* */
942
+ /* */
943
+ /* */
944
+ /* */
945
+ /* */
946
+ /* */
947
+ /* */
948
+ /* */
949
+ /* */
950
+ /* */
951
+ /* */
952
+ /* */
953
+ /* */
954
+ /* */
955
+ /* */
956
+ /* */
957
+ /* */
958
+ /* */
959
+ /* */
960
+ /* */
961
+ /* */
962
+ /* */
963
+ /* */
964
+ /* */
965
+ /* */
966
+ /* */
967
+ /* */
968
+ /* */
969
+ /* */
970
+ /* */
971
+ /* */
972
+ /* */
973
+ /* */
974
+ /* */
975
+ /* */
976
+ /* */
977
+ /* */
978
+ /* */
979
+ /* */
980
+ }
981
+ }
982
+ function transformData(details) {
983
+ if (typeof details === 'object') {
984
+ if (Array.isArray(details)) {
985
+ return details.join('\n');
986
+ }
987
+ try {
988
+ const json = JSON.stringify(details);
989
+ details = json;
990
+ }
991
+ catch (error) {
992
+ return details;
993
+ }
994
+ }
995
+ return details;
996
+ }
997
+ ;
998
998
  ({}); // @--end-of-file-for-module=tnp-core lib/helpers-messages.ts
999
999
 
1000
- const encoding = 'utf8';
1001
- const WEBSQL_PROC_MOCK_PROCESSES_PID = {};
1002
- const WEBSQL_PROC_MOCK_PROCESSES_PPID = {};
1003
- class HelpersCore extends HelpersMessages {
1004
- constructor() {
1005
- super();
1006
- /* */
1007
- /* */
1008
- /* */
1009
- /* */
1010
- /* */
1011
- /* */
1012
- /* */
1013
- /* */
1014
- /* */
1015
- /* */
1016
- /* */
1017
- /* */
1018
- /* */
1019
- /* */
1020
- /* */
1021
- /* */
1022
- /* */
1023
- /* */
1024
- /* */
1025
- /* */
1026
- /* */
1027
- /* */
1028
- this.bigMaxBuffer = 2024 * 500;
1029
- /* */
1030
- /* */
1031
- /* */
1032
- }
1033
- static get InstanceCore() {
1034
- if (!HelpersCore._instanceCore) {
1035
- HelpersCore._instanceCore = new HelpersCore();
1036
- }
1037
- return HelpersCore._instanceCore;
1038
- }
1039
- removeSlashAtEnd(s) {
1040
- s = (s === null || s === void 0 ? void 0 : s.endsWith(`/`)) ? s.slice(0, s.length - 1) : s;
1041
- return s;
1042
- }
1043
- removeSlashAtBegin(s) {
1044
- s = (s === null || s === void 0 ? void 0 : s.startsWith(`/`)) ? s.slice(1) : s;
1045
- return s;
1046
- }
1047
- stringify(inputObject) {
1048
- return JSON.stringify(inputObject, null, 2);
1049
- }
1050
- runSyncOrAsync(fnOrOptions, ...firstArg) {
1051
- return __awaiter(this, void 0, void 0, function* () {
1052
- if (_.isUndefined(fnOrOptions)) {
1053
- return;
1054
- }
1055
- let promisOrValue;
1056
- const optionsMode = _.isObject(fnOrOptions)
1057
- && !_.isArray(fnOrOptions)
1058
- && !_.isFunction(fnOrOptions)
1059
- && !_.isNil(fnOrOptions);
1060
- if (optionsMode) {
1061
- const { functionFn, context, arrayOfParams } = fnOrOptions;
1062
- promisOrValue = functionFn.apply(context, arrayOfParams);
1063
- }
1064
- else {
1065
- // @ts-ignore
1066
- promisOrValue = _.isArray(fnOrOptions) ? fnOrOptions[1][fnOrOptions[0]](...firstArg) : fnOrOptions(...firstArg);
1067
- }
1068
- if (promisOrValue instanceof Promise) {
1069
- promisOrValue = Promise.resolve(promisOrValue);
1070
- }
1071
- return promisOrValue;
1072
- });
1073
- }
1074
- /* */
1075
- /* */
1076
- /* */
1077
- /* */
1078
- /* */
1079
- /* */
1080
- /* */
1081
- /* */
1082
- /* */
1083
- /* */
1084
- /* */
1085
- /* */
1086
- /* */
1087
- /* */
1088
- /* */
1089
- /* */
1090
- /* */
1091
- /* */
1092
- /* */
1093
- /* */
1094
- /* */
1095
- /* */
1096
- /* */
1097
- /* */
1098
- /* */
1099
- /* */
1100
- /* */
1101
- /* */
1102
- /* */
1103
- /* */
1104
- /* */
1105
- /* */
1106
- /* */
1107
- /* */
1108
- /* */
1109
- /* */
1110
- /* */
1111
- /* */
1112
- /* */
1113
- /* */
1114
- /* */
1115
- /* */
1116
- /* */
1117
- /* */
1118
- /* */
1119
- /* */
1120
- /* */
1121
- /* */
1122
- /* */
1123
- /* */
1124
- /* */
1125
- /* */
1126
- /* */
1127
- /* */
1128
- /* */
1129
- /* */
1130
- /* */
1131
- /* */
1132
- /* */
1133
- /* */
1134
- /* */
1135
- /* */
1136
- /* */
1137
- /* */
1138
- /* */
1139
- /* */
1140
- /* */
1141
- /* */
1142
- /* */
1143
- /* */
1144
- /* */
1145
- /* */
1146
- /* */
1147
- /* */
1148
- /* */
1149
- /* */
1150
- /* */
1151
- /* */
1152
- /* */
1153
- /* */
1154
- /* */
1155
- /* */
1156
- /* */
1157
- /* */
1158
- /* */
1159
- /* */
1160
- /* */
1161
- /* */
1162
- /* */
1163
- /* */
1164
- /* */
1165
- /* */
1166
- /* */
1167
- /* */
1168
- /* */
1169
- /* */
1170
- /* */
1171
- /* */
1172
- /* */
1173
- /* */
1174
- /* */
1175
- /* */
1176
- /* */
1177
- /* */
1178
- /* */
1179
- /* */
1180
- /* */
1181
- /* */
1182
- /* */
1183
- /* */
1184
- /* */
1185
- /* */
1186
- /* */
1187
- /* */
1188
- /* */
1189
- /* */
1190
- /* */
1191
- /* */
1192
- /* */
1193
- /* */
1194
- /* */
1195
- /* */
1196
- /* */
1197
- /* */
1198
- /* */
1199
- /* */
1200
- /* */
1201
- /* */
1202
- /* */
1203
- /* */
1204
- /* */
1205
- /* */
1206
- /* */
1207
- /* */
1208
- /* */
1209
- /* */
1210
- /* */
1211
- /* */
1212
- /* */
1213
- /* */
1214
- /* */
1215
- /* */
1216
- /* */
1217
- /* */
1218
- /* */
1219
- /* */
1220
- /* */
1221
- /* */
1222
- /* */
1223
- /* */
1224
- /* */
1225
- /* */
1226
- /* */
1227
- /* */
1228
- /* */
1229
- /* */
1230
- /* */
1231
- /* */
1232
- /* */
1233
- /* */
1234
- /* */
1235
- /* */
1236
- /* */
1237
- /* */
1238
- /* */
1239
- /* */
1240
- /* */
1241
- /* */
1242
- /* */
1243
- /* */
1244
- /* */
1245
- /* */
1246
- /* */
1247
- /* */
1248
- /* */
1249
- /* */
1250
- /* */
1251
- /* */
1252
- /* */
1253
- /* */
1254
- /* */
1255
- /* */
1256
- /* */
1257
- /* */
1258
- /* */
1259
- /* */
1260
- /* */
1261
- /* */
1262
- /* */
1263
- /* */
1264
- /* */
1265
- /* */
1266
- /* */
1267
- /* */
1268
- /* */
1269
- /* */
1270
- /* */
1271
- /* */
1272
- /* */
1273
- /* */
1274
- /* */
1275
- /* */
1276
- /* */
1277
- /* */
1278
- /* */
1279
- /* */
1280
- /* */
1281
- /* */
1282
- /* */
1283
- /* */
1284
- /* */
1285
- /* */
1286
- /* */
1287
- /* */
1288
- /* */
1289
- /* */
1290
- /**
1291
- * symlink may have existed or unexisted destiantion url
1292
- * @param destUrl M
1293
- */
1294
- isSymlinkThatMatchesUrl(possibleSymlink, destUrl, absoluteFileMatch = false) {
1295
- /* */
1296
- /* */
1297
- /* */
1298
- /* */
1299
- /* */
1300
- /* */
1301
- /* */
1302
- /* */
1303
- /* */
1304
- /* */
1305
- /* */
1306
- /* */
1307
- /* */
1308
- /* */
1309
- /* */
1310
- /* */
1311
- /* */
1312
- /* */
1313
- /* */
1314
- /* */
1315
- /* */
1316
- /* */
1317
- /* */
1318
- /* */
1319
- /* */
1320
- /* */
1321
- /* */
1322
- /* */
1323
- /* */
1324
- /* */
1325
- /* */
1326
- return (void 0);
1327
- }
1328
- isSymlinkFileExitedOrUnexisted(filePath) {
1329
- /* */
1330
- /* */
1331
- /* */
1332
- /* */
1333
- /* */
1334
- /* */
1335
- /* */
1336
- return (void 0);
1337
- }
1338
- /**
1339
- * If symbolnk link that target file does not exits
1340
- */
1341
- isUnexistedLink(filePath) {
1342
- /* */
1343
- /* */
1344
- /* */
1345
- /* */
1346
- /* */
1347
- /* */
1348
- /* */
1349
- /* */
1350
- /* */
1351
- /* */
1352
- /* */
1353
- /* */
1354
- return (void 0);
1355
- }
1356
- /**
1357
- * @param existedLink check if source of link exists
1358
- */
1359
- isExistedSymlink(filePath) {
1360
- /* */
1361
- /* */
1362
- /* */
1363
- /* */
1364
- /* */
1365
- /* */
1366
- /* */
1367
- /* */
1368
- /* */
1369
- /* */
1370
- /* */
1371
- /* */
1372
- return (void 0);
1373
- }
1374
- /* */
1375
- /* */
1376
- /* */
1377
- /* */
1378
- /* */
1379
- /* */
1380
- /* */
1381
- /* */
1382
- /* */
1383
- /* */
1384
- /* */
1385
- /* */
1386
- /* */
1387
- /* */
1388
- /* */
1389
- /* */
1390
- /* */
1391
- exists(folderOrFilePath) {
1392
- /* */
1393
- /* */
1394
- /* */
1395
- /* */
1396
- /* */
1397
- /* */
1398
- /* */
1399
- /* */
1400
- /* */
1401
- /* */
1402
- /* */
1403
- /* */
1404
- /* */
1405
- /* */
1406
- /* */
1407
- /* */
1408
- /* */
1409
- /* */
1410
- /* */
1411
- return (void 0);
1412
- }
1413
- _fixCommand(command) {
1414
- if ((command.startsWith('tnp ') || command.startsWith('firedev ')) // TODO every cli projects here that uses run and need to kill process easly!
1415
- &&
1416
- (command.search('-spinner=false') === -1) && (command.search('-spinner=off') === -1)) {
1417
- command = `${command} -spinner=false`;
1418
- }
1419
- if (global.skipCoreCheck && (command.startsWith('tnp ') || command.startsWith('firedev '))) {
1420
- command = `${command} --skipCoreCheck`;
1421
- }
1422
- return command;
1423
- }
1424
- command(command) {
1425
- command = Helpers._fixCommand(command);
1426
- return {
1427
- /* */
1428
- /* */
1429
- /* */
1430
- /* */
1431
- /* */
1432
- /* */
1433
- /* */
1434
- /* */
1435
- /* */
1436
- /* */
1437
- /* */
1438
- /* */
1439
- /* */
1440
- /* */
1441
- /* */
1442
- /* */
1443
- /* */
1444
- /* */
1445
- /* */
1446
- /* */
1447
- /* */
1448
- /* */
1449
- /* */
1450
- /* */
1451
- /* */
1452
- /* */
1453
- /* */
1454
- /* */
1455
- /* */
1456
- /* */
1457
- /* */
1458
- /* */
1459
- /* */
1460
- /* */
1461
- /* */
1462
- /* */
1463
- /* */
1464
- /* */
1465
- /* */
1466
- /* */
1467
- /* */
1468
- /* */
1469
- /* */
1470
- /* */
1471
- /* */
1472
- /* */
1473
- /* */
1474
- /* */
1475
- /* */
1476
- /* */
1477
- };
1478
- }
1479
- wait(second) {
1480
- return new Promise((resolve, reject) => {
1481
- setTimeout(() => {
1482
- resolve(void 0);
1483
- }, second * 1000);
1484
- });
1485
- }
1486
- /* */
1487
- /* */
1488
- /* */
1489
- /* */
1490
- /* */
1491
- /* */
1492
- /* */
1493
- /* */
1494
- /* */
1495
- /* */
1496
- /* */
1497
- /* */
1498
- /* */
1499
- /* */
1500
- /* */
1501
- /* */
1502
- /* */
1503
- /* */
1504
- /* */
1505
- /* */
1506
- /* */
1507
- /* */
1508
- /* */
1509
- /* */
1510
- /* */
1511
- /* */
1512
- /* */
1513
- /* */
1514
- /* */
1515
- /* */
1516
- /* */
1517
- /* */
1518
- /* */
1519
- /* */
1520
- /* */
1521
- /* */
1522
- /* */
1523
- /* */
1524
- /* */
1525
- /* */
1526
- /* */
1527
- /* */
1528
- /* */
1529
- /* */
1530
- /* */
1531
- /* */
1532
- /* */
1533
- /* */
1534
- /* */
1535
- /* */
1536
- /* */
1537
- /* */
1538
- /* */
1539
- /* */
1540
- /* */
1541
- /* */
1542
- /* */
1543
- /* */
1544
- /* */
1545
- /* */
1546
- /* */
1547
- /* */
1548
- /* */
1549
- /* */
1550
- /* */
1551
- /* */
1552
- /* */
1553
- /* */
1554
- /* */
1555
- /* */
1556
- killProcess(byPid) {
1557
- /* */
1558
- /* */
1559
- /* */
1560
- /* */
1561
- /* */
1562
- if (WEBSQL_PROC_MOCK_PROCESSES_PID[byPid]) {
1563
- const ppid = WEBSQL_PROC_MOCK_PROCESSES_PID[byPid].ppid;
1564
- if (WEBSQL_PROC_MOCK_PROCESSES_PPID[ppid]) {
1565
- const allChilds = WEBSQL_PROC_MOCK_PROCESSES_PPID[ppid].childProcesses;
1566
- WEBSQL_PROC_MOCK_PROCESSES_PPID[ppid].childProcesses = allChilds.filter(p => p !== byPid);
1567
- }
1568
- delete WEBSQL_PROC_MOCK_PROCESSES_PID[byPid];
1569
- }
1570
- if (WEBSQL_PROC_MOCK_PROCESSES_PPID[byPid]) {
1571
- const childs = WEBSQL_PROC_MOCK_PROCESSES_PPID[byPid].childProcesses;
1572
- for (let index = 0; index < childs.length; index++) {
1573
- const childPid = childs[index];
1574
- delete WEBSQL_PROC_MOCK_PROCESSES_PID[childPid];
1575
- }
1576
- delete WEBSQL_PROC_MOCK_PROCESSES_PPID[byPid];
1577
- }
1578
- }
1579
- run(command, options) {
1580
- command = Helpers._fixCommand(command);
1581
- /* */
1582
- /* */
1583
- /* */
1584
- /* */
1585
- /* */
1586
- /* */
1587
- /* */
1588
- /* */
1589
- return {
1590
- /* */
1591
- /* */
1592
- /* */
1593
- /* */
1594
- /* */
1595
- /* */
1596
- /* */
1597
- /* */
1598
- /* */
1599
- /* */
1600
- /* */
1601
- /* */
1602
- /* */
1603
- /* */
1604
- /* */
1605
- /* */
1606
- /* */
1607
- /* */
1608
- /* */
1609
- /* */
1610
- /* */
1611
- /* */
1612
- /* */
1613
- /* */
1614
- async(detach = false, mockFun) {
1615
- if (mockFun) {
1616
- const subStdoutSub = new Subject();
1617
- const subStderSub = new Subject();
1618
- const exitSub = new Subject();
1619
- const subscribtions = [];
1620
- const procDummy = {
1621
- stdout: {
1622
- on(action, stdoutCallback) {
1623
- if (action == 'data') {
1624
- subscribtions.push(subStdoutSub.subscribe(d => {
1625
- stdoutCallback(d);
1626
- }));
1627
- }
1628
- }
1629
- },
1630
- stderr: {
1631
- on(action, stdoutCallback) {
1632
- if (action == 'data') {
1633
- subscribtions.push(subStderSub.subscribe(d => {
1634
- stdoutCallback(d);
1635
- }));
1636
- }
1637
- }
1638
- },
1639
- on(action, exitFun) {
1640
- if (action == 'exit') {
1641
- subscribtions.push(exitSub.subscribe(d => {
1642
- exitFun(d);
1643
- }));
1644
- }
1645
- },
1646
- ppid: void 0,
1647
- pid: void 0,
1648
- };
1649
- procDummy.pid = Math.round(Math.random() * (1000 - 100)) + 100;
1650
- procDummy.ppid = procDummy.pid + 9999;
1651
- WEBSQL_PROC_MOCK_PROCESSES_PID[procDummy.pid] = procDummy;
1652
- if (!WEBSQL_PROC_MOCK_PROCESSES_PPID[procDummy.ppid]) {
1653
- WEBSQL_PROC_MOCK_PROCESSES_PPID[procDummy.ppid] = {
1654
- childProcesses: [],
1655
- };
1656
- }
1657
- WEBSQL_PROC_MOCK_PROCESSES_PPID[procDummy.ppid].childProcesses.push(procDummy.pid);
1658
- const checkIfProcessShouldBeDead = () => {
1659
- return _.isNil(WEBSQL_PROC_MOCK_PROCESSES_PID[procDummy.pid]) || _.isNil(WEBSQL_PROC_MOCK_PROCESSES_PPID[procDummy.ppid]);
1660
- };
1661
- const f = Helpers.runSyncOrAsync(mockFun, (d) => {
1662
- setTimeout(() => {
1663
- subStdoutSub.next(d);
1664
- });
1665
- }, (d) => {
1666
- setTimeout(() => {
1667
- subStderSub.next(d);
1668
- });
1669
- }, () => {
1670
- const shouldBeDead = checkIfProcessShouldBeDead();
1671
- return shouldBeDead;
1672
- });
1673
- f.then(exitCode => {
1674
- if (_.isNil(exitCode)) {
1675
- exitCode = 0;
1676
- }
1677
- setTimeout(() => {
1678
- exitSub.next(exitCode);
1679
- subscribtions.forEach(s => s.unsubscribe());
1680
- });
1681
- }).catch((e) => {
1682
- console.error(e);
1683
- console.error(`Something wrong with your mock funciton`);
1684
- exitSub.next(1);
1685
- subscribtions.forEach(s => s.unsubscribe());
1686
- });
1687
- return procDummy;
1688
- }
1689
- /* */
1690
- /* */
1691
- /* */
1692
- return (void 0);
1693
- },
1694
- /* */
1695
- /* */
1696
- /* */
1697
- /* */
1698
- /* */
1699
- /* */
1700
- /* */
1701
- /* */
1702
- /* */
1703
- /* */
1704
- /* */
1705
- /* */
1706
- /* */
1707
- /* */
1708
- /* */
1709
- /* */
1710
- /* */
1711
- /* */
1712
- /* */
1713
- /* */
1714
- /* */
1715
- /* */
1716
- /* */
1717
- /* */
1718
- /* */
1719
- /* */
1720
- /* */
1721
- /* */
1722
- /* */
1723
- /* */
1724
- /* */
1725
- /* */
1726
- /* */
1727
- /* */
1728
- /* */
1729
- /* */
1730
- /* */
1731
- /* */
1732
- /* */
1733
- /* */
1734
- /* */
1735
- /* */
1736
- /* */
1737
- /* */
1738
- /* */
1739
- /* */
1740
- /* */
1741
- /* */
1742
- /* */
1743
- /* */
1744
- /* */
1745
- /* */
1746
- /* */
1747
- /* */
1748
- /* */
1749
- /* */
1750
- /* */
1751
- /* */
1752
- /* */
1753
- /* */
1754
- /* */
1755
- /* */
1756
- /* */
1757
- /* */
1758
- /* */
1759
- /* */
1760
- /* */
1761
- /* */
1762
- /* */
1763
- /* */
1764
- /* */
1765
- /* */
1766
- /* */
1767
- /* */
1768
- /* */
1769
- /* */
1770
- /* */
1771
- /* */
1772
- /* */
1773
- /* */
1774
- /* */
1775
- /* */
1776
- /* */
1777
- /* */
1778
- /* */
1779
- /* */
1780
- };
1781
- }
1782
- /* */
1783
- /* */
1784
- /* */
1785
- /* */
1786
- /* */
1787
- /* */
1788
- /* */
1789
- /* */
1790
- /* */
1791
- /* */
1792
- /* */
1793
- /* */
1794
- /* */
1795
- /* */
1796
- /* */
1797
- /* */
1798
- /* */
1799
- /* */
1800
- /* */
1801
- /* */
1802
- /* */
1803
- /* */
1804
- /* */
1805
- /* */
1806
- /* */
1807
- /* */
1808
- /* */
1809
- /* */
1810
- /* */
1811
- /* */
1812
- /* */
1813
- /* */
1814
- /* */
1815
- /* */
1816
- /* */
1817
- /* */
1818
- /* */
1819
- /* */
1820
- /* */
1821
- /* */
1822
- /* */
1823
- /* */
1824
- /* */
1825
- /* */
1826
- /* */
1827
- /* */
1828
- /* */
1829
- /* */
1830
- /* */
1831
- /* */
1832
- /* */
1833
- /* */
1834
- /* */
1835
- /* */
1836
- /* */
1837
- /* */
1838
- /* */
1839
- /* */
1840
- /* */
1841
- /* */
1842
- /* */
1843
- /* */
1844
- /* */
1845
- /* */
1846
- /* */
1847
- /* */
1848
- /* */
1849
- /* */
1850
- /* */
1851
- /* */
1852
- /* */
1853
- /* */
1854
- /* */
1855
- /* */
1856
- /* */
1857
- /* */
1858
- /* */
1859
- /* */
1860
- /* */
1861
- /* */
1862
- /* */
1863
- /* */
1864
- /* */
1865
- /* */
1866
- /* */
1867
- /* */
1868
- /* */
1869
- /* */
1870
- /* */
1871
- /* */
1872
- /* */
1873
- /* */
1874
- /* */
1875
- /* */
1876
- /* */
1877
- /* */
1878
- /* */
1879
- /* */
1880
- /* */
1881
- /* */
1882
- /* */
1883
- /* */
1884
- /* */
1885
- /* */
1886
- /* */
1887
- /* */
1888
- /* */
1889
- /* */
1890
- /* */
1891
- /* */
1892
- /* */
1893
- /* */
1894
- /* */
1895
- /* */
1896
- /* */
1897
- /* */
1898
- /* */
1899
- /* */
1900
- /* */
1901
- /* */
1902
- /* */
1903
- /* */
1904
- /* */
1905
- /* */
1906
- /* */
1907
- /* */
1908
- /* */
1909
- /* */
1910
- /* */
1911
- /* */
1912
- /* */
1913
- /* */
1914
- /* */
1915
- /* */
1916
- /* */
1917
- /* */
1918
- /* */
1919
- /* */
1920
- /* */
1921
- /* */
1922
- /* */
1923
- /* */
1924
- /* */
1925
- /* */
1926
- /* */
1927
- /* */
1928
- /* */
1929
- /* */
1930
- /* */
1931
- /* */
1932
- /* */
1933
- /* */
1934
- /* */
1935
- /* */
1936
- /* */
1937
- /* */
1938
- /* */
1939
- /* */
1940
- /* */
1941
- /* */
1942
- /* */
1943
- /* */
1944
- /* */
1945
- /* */
1946
- /* */
1947
- /* */
1948
- /* */
1949
- /* */
1950
- /* */
1951
- /* */
1952
- /* */
1953
- /* */
1954
- /* */
1955
- /* */
1956
- /* */
1957
- /* */
1958
- /* */
1959
- /* */
1960
- /* */
1961
- /* */
1962
- /* */
1963
- /* */
1964
- /* */
1965
- /* */
1966
- /* */
1967
- /* */
1968
- /* */
1969
- /* */
1970
- /* */
1971
- /* */
1972
- /* */
1973
- /* */
1974
- /* */
1975
- /* */
1976
- /* */
1977
- /* */
1978
- /* */
1979
- /* */
1980
- /* */
1981
- /* */
1982
- /* */
1983
- /* */
1984
- /* */
1985
- /* */
1986
- /* */
1987
- /* */
1988
- /* */
1989
- /* */
1990
- /* */
1991
- /* */
1992
- /* */
1993
- /* */
1994
- /* */
1995
- /* */
1996
- /* */
1997
- /* */
1998
- /* */
1999
- /* */
2000
- /* */
2001
- /* */
2002
- /* */
2003
- /* */
2004
- /* */
2005
- /* */
2006
- /* */
2007
- /* */
2008
- /* */
2009
- /* */
2010
- /* */
2011
- /* */
2012
- /* */
2013
- /* */
2014
- /* */
2015
- /* */
2016
- /* */
2017
- /* */
2018
- /* */
2019
- /* */
2020
- /* */
2021
- /* */
2022
- /* */
2023
- /* */
2024
- /* */
2025
- /* */
2026
- /* */
2027
- /* */
2028
- /* */
2029
- /* */
2030
- /* */
2031
- /* */
2032
- /* */
2033
- /* */
2034
- /* */
2035
- /* */
2036
- /* */
2037
- /* */
2038
- /* */
2039
- /* */
2040
- /* */
2041
- /* */
2042
- /* */
2043
- /* */
2044
- /* */
2045
- /* */
2046
- /* */
2047
- /* */
2048
- /* */
2049
- /* */
2050
- /* */
2051
- /* */
2052
- /* */
2053
- /* */
2054
- /* */
2055
- /* */
2056
- /* */
2057
- /* */
2058
- /* */
2059
- /* */
2060
- /* */
2061
- /* */
2062
- /* */
2063
- /* */
2064
- /* */
2065
- /* */
2066
- /* */
2067
- /* */
2068
- /* */
2069
- /* */
2070
- /* */
2071
- /* */
2072
- /* */
2073
- /* */
2074
- /* */
2075
- /* */
2076
- /* */
2077
- /* */
2078
- /* */
2079
- /* */
2080
- /* */
2081
- /* */
2082
- /* */
2083
- /* */
2084
- /* */
2085
- /* */
2086
- /* */
2087
- /* */
2088
- /* */
2089
- /* */
2090
- /* */
2091
- /* */
2092
- /* */
2093
- /* */
2094
- /* */
2095
- /* */
2096
- /* */
2097
- /* */
2098
- /* */
2099
- /* */
2100
- /* */
2101
- /* */
2102
- /* */
2103
- /* */
2104
- /* */
2105
- /* */
2106
- /* */
2107
- /* */
2108
- /* */
2109
- /* */
2110
- /* */
2111
- /* */
2112
- /* */
2113
- /* */
2114
- /* */
2115
- /* */
2116
- /* */
2117
- /* */
2118
- /* */
2119
- /* */
2120
- /* */
2121
- /* */
2122
- /* */
2123
- /* */
2124
- /* */
2125
- /* */
2126
- /* */
2127
- /* */
2128
- /* */
2129
- /* */
2130
- /* */
2131
- /* */
2132
- /* */
2133
- /* */
2134
- /* */
2135
- /* */
2136
- /* */
2137
- /* */
2138
- /* */
2139
- /* */
2140
- /* */
2141
- /* */
2142
- /**
2143
- * Quick fix for object values
2144
- */
2145
- values(obj) {
2146
- if (_.isObject(obj) && !Array.isArray(obj)) {
2147
- const values = [];
2148
- for (const key in obj) {
2149
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
2150
- values.push(obj[key]);
2151
- }
2152
- }
2153
- return values;
2154
- }
2155
- return [];
2156
- }
2157
- }
2158
- ;
1000
+ const encoding = 'utf8';
1001
+ const WEBSQL_PROC_MOCK_PROCESSES_PID = {};
1002
+ const WEBSQL_PROC_MOCK_PROCESSES_PPID = {};
1003
+ class HelpersCore extends HelpersMessages {
1004
+ constructor() {
1005
+ super();
1006
+ /* */
1007
+ /* */
1008
+ /* */
1009
+ /* */
1010
+ /* */
1011
+ /* */
1012
+ /* */
1013
+ /* */
1014
+ /* */
1015
+ /* */
1016
+ /* */
1017
+ /* */
1018
+ /* */
1019
+ /* */
1020
+ /* */
1021
+ /* */
1022
+ /* */
1023
+ /* */
1024
+ /* */
1025
+ /* */
1026
+ /* */
1027
+ /* */
1028
+ this.bigMaxBuffer = 2024 * 500;
1029
+ /* */
1030
+ /* */
1031
+ /* */
1032
+ }
1033
+ static get InstanceCore() {
1034
+ if (!HelpersCore._instanceCore) {
1035
+ HelpersCore._instanceCore = new HelpersCore();
1036
+ }
1037
+ return HelpersCore._instanceCore;
1038
+ }
1039
+ removeSlashAtEnd(s) {
1040
+ s = (s === null || s === void 0 ? void 0 : s.endsWith(`/`)) ? s.slice(0, s.length - 1) : s;
1041
+ return s;
1042
+ }
1043
+ removeSlashAtBegin(s) {
1044
+ s = (s === null || s === void 0 ? void 0 : s.startsWith(`/`)) ? s.slice(1) : s;
1045
+ return s;
1046
+ }
1047
+ stringify(inputObject) {
1048
+ return JSON.stringify(inputObject, null, 2);
1049
+ }
1050
+ runSyncOrAsync(fnOrOptions, ...firstArg) {
1051
+ return __awaiter(this, void 0, void 0, function* () {
1052
+ if (_.isUndefined(fnOrOptions)) {
1053
+ return;
1054
+ }
1055
+ let promisOrValue;
1056
+ const optionsMode = _.isObject(fnOrOptions)
1057
+ && !_.isArray(fnOrOptions)
1058
+ && !_.isFunction(fnOrOptions)
1059
+ && !_.isNil(fnOrOptions);
1060
+ if (optionsMode) {
1061
+ const { functionFn, context, arrayOfParams } = fnOrOptions;
1062
+ promisOrValue = functionFn.apply(context, arrayOfParams);
1063
+ }
1064
+ else {
1065
+ // @ts-ignore
1066
+ promisOrValue = _.isArray(fnOrOptions) ? fnOrOptions[1][fnOrOptions[0]](...firstArg) : fnOrOptions(...firstArg);
1067
+ }
1068
+ if (promisOrValue instanceof Promise) {
1069
+ promisOrValue = Promise.resolve(promisOrValue);
1070
+ }
1071
+ return promisOrValue;
1072
+ });
1073
+ }
1074
+ /* */
1075
+ /* */
1076
+ /* */
1077
+ /* */
1078
+ /* */
1079
+ /* */
1080
+ /* */
1081
+ /* */
1082
+ /* */
1083
+ /* */
1084
+ /* */
1085
+ /* */
1086
+ /* */
1087
+ /* */
1088
+ /* */
1089
+ /* */
1090
+ /* */
1091
+ /* */
1092
+ /* */
1093
+ /* */
1094
+ /* */
1095
+ /* */
1096
+ /* */
1097
+ /* */
1098
+ /* */
1099
+ /* */
1100
+ /* */
1101
+ /* */
1102
+ /* */
1103
+ /* */
1104
+ /* */
1105
+ /* */
1106
+ /* */
1107
+ /* */
1108
+ /* */
1109
+ /* */
1110
+ /* */
1111
+ /* */
1112
+ /* */
1113
+ /* */
1114
+ /* */
1115
+ /* */
1116
+ /* */
1117
+ /* */
1118
+ /* */
1119
+ /* */
1120
+ /* */
1121
+ /* */
1122
+ /* */
1123
+ /* */
1124
+ /* */
1125
+ /* */
1126
+ /* */
1127
+ /* */
1128
+ /* */
1129
+ /* */
1130
+ /* */
1131
+ /* */
1132
+ /* */
1133
+ /* */
1134
+ /* */
1135
+ /* */
1136
+ /* */
1137
+ /* */
1138
+ /* */
1139
+ /* */
1140
+ /* */
1141
+ /* */
1142
+ /* */
1143
+ /* */
1144
+ /* */
1145
+ /* */
1146
+ /* */
1147
+ /* */
1148
+ /* */
1149
+ /* */
1150
+ /* */
1151
+ /* */
1152
+ /* */
1153
+ /* */
1154
+ /* */
1155
+ /* */
1156
+ /* */
1157
+ /* */
1158
+ /* */
1159
+ /* */
1160
+ /* */
1161
+ /* */
1162
+ /* */
1163
+ /* */
1164
+ /* */
1165
+ /* */
1166
+ /* */
1167
+ /* */
1168
+ /* */
1169
+ /* */
1170
+ /* */
1171
+ /* */
1172
+ /* */
1173
+ /* */
1174
+ /* */
1175
+ /* */
1176
+ /* */
1177
+ /* */
1178
+ /* */
1179
+ /* */
1180
+ /* */
1181
+ /* */
1182
+ /* */
1183
+ /* */
1184
+ /* */
1185
+ /* */
1186
+ /* */
1187
+ /* */
1188
+ /* */
1189
+ /* */
1190
+ /* */
1191
+ /* */
1192
+ /* */
1193
+ /* */
1194
+ /* */
1195
+ /* */
1196
+ /* */
1197
+ /* */
1198
+ /* */
1199
+ /* */
1200
+ /* */
1201
+ /* */
1202
+ /* */
1203
+ /* */
1204
+ /* */
1205
+ /* */
1206
+ /* */
1207
+ /* */
1208
+ /* */
1209
+ /* */
1210
+ /* */
1211
+ /* */
1212
+ /* */
1213
+ /* */
1214
+ /* */
1215
+ /* */
1216
+ /* */
1217
+ /* */
1218
+ /* */
1219
+ /* */
1220
+ /* */
1221
+ /* */
1222
+ /* */
1223
+ /* */
1224
+ /* */
1225
+ /* */
1226
+ /* */
1227
+ /* */
1228
+ /* */
1229
+ /* */
1230
+ /* */
1231
+ /* */
1232
+ /* */
1233
+ /* */
1234
+ /* */
1235
+ /* */
1236
+ /* */
1237
+ /* */
1238
+ /* */
1239
+ /* */
1240
+ /* */
1241
+ /* */
1242
+ /* */
1243
+ /* */
1244
+ /* */
1245
+ /* */
1246
+ /* */
1247
+ /* */
1248
+ /* */
1249
+ /* */
1250
+ /* */
1251
+ /* */
1252
+ /* */
1253
+ /* */
1254
+ /* */
1255
+ /* */
1256
+ /* */
1257
+ /* */
1258
+ /* */
1259
+ /* */
1260
+ /* */
1261
+ /* */
1262
+ /* */
1263
+ /* */
1264
+ /* */
1265
+ /* */
1266
+ /* */
1267
+ /* */
1268
+ /* */
1269
+ /* */
1270
+ /* */
1271
+ /* */
1272
+ /* */
1273
+ /* */
1274
+ /* */
1275
+ /* */
1276
+ /* */
1277
+ /* */
1278
+ /* */
1279
+ /* */
1280
+ /* */
1281
+ /* */
1282
+ /* */
1283
+ /* */
1284
+ /* */
1285
+ /* */
1286
+ /* */
1287
+ /* */
1288
+ /* */
1289
+ /* */
1290
+ /**
1291
+ * symlink may have existed or unexisted destiantion url
1292
+ * @param destUrl M
1293
+ */
1294
+ isSymlinkThatMatchesUrl(possibleSymlink, destUrl, absoluteFileMatch = false) {
1295
+ /* */
1296
+ /* */
1297
+ /* */
1298
+ /* */
1299
+ /* */
1300
+ /* */
1301
+ /* */
1302
+ /* */
1303
+ /* */
1304
+ /* */
1305
+ /* */
1306
+ /* */
1307
+ /* */
1308
+ /* */
1309
+ /* */
1310
+ /* */
1311
+ /* */
1312
+ /* */
1313
+ /* */
1314
+ /* */
1315
+ /* */
1316
+ /* */
1317
+ /* */
1318
+ /* */
1319
+ /* */
1320
+ /* */
1321
+ /* */
1322
+ /* */
1323
+ /* */
1324
+ /* */
1325
+ /* */
1326
+ return (void 0);
1327
+ }
1328
+ isSymlinkFileExitedOrUnexisted(filePath) {
1329
+ /* */
1330
+ /* */
1331
+ /* */
1332
+ /* */
1333
+ /* */
1334
+ /* */
1335
+ /* */
1336
+ return (void 0);
1337
+ }
1338
+ /**
1339
+ * If symbolnk link that target file does not exits
1340
+ */
1341
+ isUnexistedLink(filePath) {
1342
+ /* */
1343
+ /* */
1344
+ /* */
1345
+ /* */
1346
+ /* */
1347
+ /* */
1348
+ /* */
1349
+ /* */
1350
+ /* */
1351
+ /* */
1352
+ /* */
1353
+ /* */
1354
+ return (void 0);
1355
+ }
1356
+ /**
1357
+ * @param existedLink check if source of link exists
1358
+ */
1359
+ isExistedSymlink(filePath) {
1360
+ /* */
1361
+ /* */
1362
+ /* */
1363
+ /* */
1364
+ /* */
1365
+ /* */
1366
+ /* */
1367
+ /* */
1368
+ /* */
1369
+ /* */
1370
+ /* */
1371
+ /* */
1372
+ return (void 0);
1373
+ }
1374
+ /* */
1375
+ /* */
1376
+ /* */
1377
+ /* */
1378
+ /* */
1379
+ /* */
1380
+ /* */
1381
+ /* */
1382
+ /* */
1383
+ /* */
1384
+ /* */
1385
+ /* */
1386
+ /* */
1387
+ /* */
1388
+ /* */
1389
+ /* */
1390
+ /* */
1391
+ exists(folderOrFilePath) {
1392
+ /* */
1393
+ /* */
1394
+ /* */
1395
+ /* */
1396
+ /* */
1397
+ /* */
1398
+ /* */
1399
+ /* */
1400
+ /* */
1401
+ /* */
1402
+ /* */
1403
+ /* */
1404
+ /* */
1405
+ /* */
1406
+ /* */
1407
+ /* */
1408
+ /* */
1409
+ /* */
1410
+ /* */
1411
+ return (void 0);
1412
+ }
1413
+ _fixCommand(command) {
1414
+ if ((command.startsWith('tnp ') || command.startsWith('firedev ')) // TODO every cli projects here that uses run and need to kill process easly!
1415
+ &&
1416
+ (command.search('-spinner=false') === -1) && (command.search('-spinner=off') === -1)) {
1417
+ command = `${command} -spinner=false`;
1418
+ }
1419
+ if (global.skipCoreCheck && (command.startsWith('tnp ') || command.startsWith('firedev '))) {
1420
+ command = `${command} --skipCoreCheck`;
1421
+ }
1422
+ return command;
1423
+ }
1424
+ command(command) {
1425
+ command = Helpers._fixCommand(command);
1426
+ return {
1427
+ /* */
1428
+ /* */
1429
+ /* */
1430
+ /* */
1431
+ /* */
1432
+ /* */
1433
+ /* */
1434
+ /* */
1435
+ /* */
1436
+ /* */
1437
+ /* */
1438
+ /* */
1439
+ /* */
1440
+ /* */
1441
+ /* */
1442
+ /* */
1443
+ /* */
1444
+ /* */
1445
+ /* */
1446
+ /* */
1447
+ /* */
1448
+ /* */
1449
+ /* */
1450
+ /* */
1451
+ /* */
1452
+ /* */
1453
+ /* */
1454
+ /* */
1455
+ /* */
1456
+ /* */
1457
+ /* */
1458
+ /* */
1459
+ /* */
1460
+ /* */
1461
+ /* */
1462
+ /* */
1463
+ /* */
1464
+ /* */
1465
+ /* */
1466
+ /* */
1467
+ /* */
1468
+ /* */
1469
+ /* */
1470
+ /* */
1471
+ /* */
1472
+ /* */
1473
+ /* */
1474
+ /* */
1475
+ /* */
1476
+ /* */
1477
+ };
1478
+ }
1479
+ wait(second) {
1480
+ return new Promise((resolve, reject) => {
1481
+ setTimeout(() => {
1482
+ resolve(void 0);
1483
+ }, second * 1000);
1484
+ });
1485
+ }
1486
+ /* */
1487
+ /* */
1488
+ /* */
1489
+ /* */
1490
+ /* */
1491
+ /* */
1492
+ /* */
1493
+ /* */
1494
+ /* */
1495
+ /* */
1496
+ /* */
1497
+ /* */
1498
+ /* */
1499
+ /* */
1500
+ /* */
1501
+ /* */
1502
+ /* */
1503
+ /* */
1504
+ /* */
1505
+ /* */
1506
+ /* */
1507
+ /* */
1508
+ /* */
1509
+ /* */
1510
+ /* */
1511
+ /* */
1512
+ /* */
1513
+ /* */
1514
+ /* */
1515
+ /* */
1516
+ /* */
1517
+ /* */
1518
+ /* */
1519
+ /* */
1520
+ /* */
1521
+ /* */
1522
+ /* */
1523
+ /* */
1524
+ /* */
1525
+ /* */
1526
+ /* */
1527
+ /* */
1528
+ /* */
1529
+ /* */
1530
+ /* */
1531
+ /* */
1532
+ /* */
1533
+ /* */
1534
+ /* */
1535
+ /* */
1536
+ /* */
1537
+ /* */
1538
+ /* */
1539
+ /* */
1540
+ /* */
1541
+ /* */
1542
+ /* */
1543
+ /* */
1544
+ /* */
1545
+ /* */
1546
+ /* */
1547
+ /* */
1548
+ /* */
1549
+ /* */
1550
+ /* */
1551
+ /* */
1552
+ /* */
1553
+ /* */
1554
+ /* */
1555
+ /* */
1556
+ killProcess(byPid) {
1557
+ /* */
1558
+ /* */
1559
+ /* */
1560
+ /* */
1561
+ /* */
1562
+ if (WEBSQL_PROC_MOCK_PROCESSES_PID[byPid]) {
1563
+ const ppid = WEBSQL_PROC_MOCK_PROCESSES_PID[byPid].ppid;
1564
+ if (WEBSQL_PROC_MOCK_PROCESSES_PPID[ppid]) {
1565
+ const allChilds = WEBSQL_PROC_MOCK_PROCESSES_PPID[ppid].childProcesses;
1566
+ WEBSQL_PROC_MOCK_PROCESSES_PPID[ppid].childProcesses = allChilds.filter(p => p !== byPid);
1567
+ }
1568
+ delete WEBSQL_PROC_MOCK_PROCESSES_PID[byPid];
1569
+ }
1570
+ if (WEBSQL_PROC_MOCK_PROCESSES_PPID[byPid]) {
1571
+ const childs = WEBSQL_PROC_MOCK_PROCESSES_PPID[byPid].childProcesses;
1572
+ for (let index = 0; index < childs.length; index++) {
1573
+ const childPid = childs[index];
1574
+ delete WEBSQL_PROC_MOCK_PROCESSES_PID[childPid];
1575
+ }
1576
+ delete WEBSQL_PROC_MOCK_PROCESSES_PPID[byPid];
1577
+ }
1578
+ }
1579
+ run(command, options) {
1580
+ command = Helpers._fixCommand(command);
1581
+ /* */
1582
+ /* */
1583
+ /* */
1584
+ /* */
1585
+ /* */
1586
+ /* */
1587
+ /* */
1588
+ /* */
1589
+ return {
1590
+ /* */
1591
+ /* */
1592
+ /* */
1593
+ /* */
1594
+ /* */
1595
+ /* */
1596
+ /* */
1597
+ /* */
1598
+ /* */
1599
+ /* */
1600
+ /* */
1601
+ /* */
1602
+ /* */
1603
+ /* */
1604
+ /* */
1605
+ /* */
1606
+ /* */
1607
+ /* */
1608
+ /* */
1609
+ /* */
1610
+ /* */
1611
+ /* */
1612
+ /* */
1613
+ /* */
1614
+ async(detach = false, mockFun) {
1615
+ if (mockFun) {
1616
+ const subStdoutSub = new Subject();
1617
+ const subStderSub = new Subject();
1618
+ const exitSub = new Subject();
1619
+ const subscribtions = [];
1620
+ const procDummy = {
1621
+ stdout: {
1622
+ on(action, stdoutCallback) {
1623
+ if (action == 'data') {
1624
+ subscribtions.push(subStdoutSub.subscribe(d => {
1625
+ stdoutCallback(d);
1626
+ }));
1627
+ }
1628
+ }
1629
+ },
1630
+ stderr: {
1631
+ on(action, stdoutCallback) {
1632
+ if (action == 'data') {
1633
+ subscribtions.push(subStderSub.subscribe(d => {
1634
+ stdoutCallback(d);
1635
+ }));
1636
+ }
1637
+ }
1638
+ },
1639
+ on(action, exitFun) {
1640
+ if (action == 'exit') {
1641
+ subscribtions.push(exitSub.subscribe(d => {
1642
+ exitFun(d);
1643
+ }));
1644
+ }
1645
+ },
1646
+ ppid: void 0,
1647
+ pid: void 0,
1648
+ };
1649
+ procDummy.pid = Math.round(Math.random() * (1000 - 100)) + 100;
1650
+ procDummy.ppid = procDummy.pid + 9999;
1651
+ WEBSQL_PROC_MOCK_PROCESSES_PID[procDummy.pid] = procDummy;
1652
+ if (!WEBSQL_PROC_MOCK_PROCESSES_PPID[procDummy.ppid]) {
1653
+ WEBSQL_PROC_MOCK_PROCESSES_PPID[procDummy.ppid] = {
1654
+ childProcesses: [],
1655
+ };
1656
+ }
1657
+ WEBSQL_PROC_MOCK_PROCESSES_PPID[procDummy.ppid].childProcesses.push(procDummy.pid);
1658
+ const checkIfProcessShouldBeDead = () => {
1659
+ return _.isNil(WEBSQL_PROC_MOCK_PROCESSES_PID[procDummy.pid]) || _.isNil(WEBSQL_PROC_MOCK_PROCESSES_PPID[procDummy.ppid]);
1660
+ };
1661
+ const f = Helpers.runSyncOrAsync(mockFun, (d) => {
1662
+ setTimeout(() => {
1663
+ subStdoutSub.next(d);
1664
+ });
1665
+ }, (d) => {
1666
+ setTimeout(() => {
1667
+ subStderSub.next(d);
1668
+ });
1669
+ }, () => {
1670
+ const shouldBeDead = checkIfProcessShouldBeDead();
1671
+ return shouldBeDead;
1672
+ });
1673
+ f.then(exitCode => {
1674
+ if (_.isNil(exitCode)) {
1675
+ exitCode = 0;
1676
+ }
1677
+ setTimeout(() => {
1678
+ exitSub.next(exitCode);
1679
+ subscribtions.forEach(s => s.unsubscribe());
1680
+ });
1681
+ }).catch((e) => {
1682
+ console.error(e);
1683
+ console.error(`Something wrong with your mock funciton`);
1684
+ exitSub.next(1);
1685
+ subscribtions.forEach(s => s.unsubscribe());
1686
+ });
1687
+ return procDummy;
1688
+ }
1689
+ /* */
1690
+ /* */
1691
+ /* */
1692
+ return (void 0);
1693
+ },
1694
+ /* */
1695
+ /* */
1696
+ /* */
1697
+ /* */
1698
+ /* */
1699
+ /* */
1700
+ /* */
1701
+ /* */
1702
+ /* */
1703
+ /* */
1704
+ /* */
1705
+ /* */
1706
+ /* */
1707
+ /* */
1708
+ /* */
1709
+ /* */
1710
+ /* */
1711
+ /* */
1712
+ /* */
1713
+ /* */
1714
+ /* */
1715
+ /* */
1716
+ /* */
1717
+ /* */
1718
+ /* */
1719
+ /* */
1720
+ /* */
1721
+ /* */
1722
+ /* */
1723
+ /* */
1724
+ /* */
1725
+ /* */
1726
+ /* */
1727
+ /* */
1728
+ /* */
1729
+ /* */
1730
+ /* */
1731
+ /* */
1732
+ /* */
1733
+ /* */
1734
+ /* */
1735
+ /* */
1736
+ /* */
1737
+ /* */
1738
+ /* */
1739
+ /* */
1740
+ /* */
1741
+ /* */
1742
+ /* */
1743
+ /* */
1744
+ /* */
1745
+ /* */
1746
+ /* */
1747
+ /* */
1748
+ /* */
1749
+ /* */
1750
+ /* */
1751
+ /* */
1752
+ /* */
1753
+ /* */
1754
+ /* */
1755
+ /* */
1756
+ /* */
1757
+ /* */
1758
+ /* */
1759
+ /* */
1760
+ /* */
1761
+ /* */
1762
+ /* */
1763
+ /* */
1764
+ /* */
1765
+ /* */
1766
+ /* */
1767
+ /* */
1768
+ /* */
1769
+ /* */
1770
+ /* */
1771
+ /* */
1772
+ /* */
1773
+ /* */
1774
+ /* */
1775
+ /* */
1776
+ /* */
1777
+ /* */
1778
+ /* */
1779
+ /* */
1780
+ };
1781
+ }
1782
+ /* */
1783
+ /* */
1784
+ /* */
1785
+ /* */
1786
+ /* */
1787
+ /* */
1788
+ /* */
1789
+ /* */
1790
+ /* */
1791
+ /* */
1792
+ /* */
1793
+ /* */
1794
+ /* */
1795
+ /* */
1796
+ /* */
1797
+ /* */
1798
+ /* */
1799
+ /* */
1800
+ /* */
1801
+ /* */
1802
+ /* */
1803
+ /* */
1804
+ /* */
1805
+ /* */
1806
+ /* */
1807
+ /* */
1808
+ /* */
1809
+ /* */
1810
+ /* */
1811
+ /* */
1812
+ /* */
1813
+ /* */
1814
+ /* */
1815
+ /* */
1816
+ /* */
1817
+ /* */
1818
+ /* */
1819
+ /* */
1820
+ /* */
1821
+ /* */
1822
+ /* */
1823
+ /* */
1824
+ /* */
1825
+ /* */
1826
+ /* */
1827
+ /* */
1828
+ /* */
1829
+ /* */
1830
+ /* */
1831
+ /* */
1832
+ /* */
1833
+ /* */
1834
+ /* */
1835
+ /* */
1836
+ /* */
1837
+ /* */
1838
+ /* */
1839
+ /* */
1840
+ /* */
1841
+ /* */
1842
+ /* */
1843
+ /* */
1844
+ /* */
1845
+ /* */
1846
+ /* */
1847
+ /* */
1848
+ /* */
1849
+ /* */
1850
+ /* */
1851
+ /* */
1852
+ /* */
1853
+ /* */
1854
+ /* */
1855
+ /* */
1856
+ /* */
1857
+ /* */
1858
+ /* */
1859
+ /* */
1860
+ /* */
1861
+ /* */
1862
+ /* */
1863
+ /* */
1864
+ /* */
1865
+ /* */
1866
+ /* */
1867
+ /* */
1868
+ /* */
1869
+ /* */
1870
+ /* */
1871
+ /* */
1872
+ /* */
1873
+ /* */
1874
+ /* */
1875
+ /* */
1876
+ /* */
1877
+ /* */
1878
+ /* */
1879
+ /* */
1880
+ /* */
1881
+ /* */
1882
+ /* */
1883
+ /* */
1884
+ /* */
1885
+ /* */
1886
+ /* */
1887
+ /* */
1888
+ /* */
1889
+ /* */
1890
+ /* */
1891
+ /* */
1892
+ /* */
1893
+ /* */
1894
+ /* */
1895
+ /* */
1896
+ /* */
1897
+ /* */
1898
+ /* */
1899
+ /* */
1900
+ /* */
1901
+ /* */
1902
+ /* */
1903
+ /* */
1904
+ /* */
1905
+ /* */
1906
+ /* */
1907
+ /* */
1908
+ /* */
1909
+ /* */
1910
+ /* */
1911
+ /* */
1912
+ /* */
1913
+ /* */
1914
+ /* */
1915
+ /* */
1916
+ /* */
1917
+ /* */
1918
+ /* */
1919
+ /* */
1920
+ /* */
1921
+ /* */
1922
+ /* */
1923
+ /* */
1924
+ /* */
1925
+ /* */
1926
+ /* */
1927
+ /* */
1928
+ /* */
1929
+ /* */
1930
+ /* */
1931
+ /* */
1932
+ /* */
1933
+ /* */
1934
+ /* */
1935
+ /* */
1936
+ /* */
1937
+ /* */
1938
+ /* */
1939
+ /* */
1940
+ /* */
1941
+ /* */
1942
+ /* */
1943
+ /* */
1944
+ /* */
1945
+ /* */
1946
+ /* */
1947
+ /* */
1948
+ /* */
1949
+ /* */
1950
+ /* */
1951
+ /* */
1952
+ /* */
1953
+ /* */
1954
+ /* */
1955
+ /* */
1956
+ /* */
1957
+ /* */
1958
+ /* */
1959
+ /* */
1960
+ /* */
1961
+ /* */
1962
+ /* */
1963
+ /* */
1964
+ /* */
1965
+ /* */
1966
+ /* */
1967
+ /* */
1968
+ /* */
1969
+ /* */
1970
+ /* */
1971
+ /* */
1972
+ /* */
1973
+ /* */
1974
+ /* */
1975
+ /* */
1976
+ /* */
1977
+ /* */
1978
+ /* */
1979
+ /* */
1980
+ /* */
1981
+ /* */
1982
+ /* */
1983
+ /* */
1984
+ /* */
1985
+ /* */
1986
+ /* */
1987
+ /* */
1988
+ /* */
1989
+ /* */
1990
+ /* */
1991
+ /* */
1992
+ /* */
1993
+ /* */
1994
+ /* */
1995
+ /* */
1996
+ /* */
1997
+ /* */
1998
+ /* */
1999
+ /* */
2000
+ /* */
2001
+ /* */
2002
+ /* */
2003
+ /* */
2004
+ /* */
2005
+ /* */
2006
+ /* */
2007
+ /* */
2008
+ /* */
2009
+ /* */
2010
+ /* */
2011
+ /* */
2012
+ /* */
2013
+ /* */
2014
+ /* */
2015
+ /* */
2016
+ /* */
2017
+ /* */
2018
+ /* */
2019
+ /* */
2020
+ /* */
2021
+ /* */
2022
+ /* */
2023
+ /* */
2024
+ /* */
2025
+ /* */
2026
+ /* */
2027
+ /* */
2028
+ /* */
2029
+ /* */
2030
+ /* */
2031
+ /* */
2032
+ /* */
2033
+ /* */
2034
+ /* */
2035
+ /* */
2036
+ /* */
2037
+ /* */
2038
+ /* */
2039
+ /* */
2040
+ /* */
2041
+ /* */
2042
+ /* */
2043
+ /* */
2044
+ /* */
2045
+ /* */
2046
+ /* */
2047
+ /* */
2048
+ /* */
2049
+ /* */
2050
+ /* */
2051
+ /* */
2052
+ /* */
2053
+ /* */
2054
+ /* */
2055
+ /* */
2056
+ /* */
2057
+ /* */
2058
+ /* */
2059
+ /* */
2060
+ /* */
2061
+ /* */
2062
+ /* */
2063
+ /* */
2064
+ /* */
2065
+ /* */
2066
+ /* */
2067
+ /* */
2068
+ /* */
2069
+ /* */
2070
+ /* */
2071
+ /* */
2072
+ /* */
2073
+ /* */
2074
+ /* */
2075
+ /* */
2076
+ /* */
2077
+ /* */
2078
+ /* */
2079
+ /* */
2080
+ /* */
2081
+ /* */
2082
+ /* */
2083
+ /* */
2084
+ /* */
2085
+ /* */
2086
+ /* */
2087
+ /* */
2088
+ /* */
2089
+ /* */
2090
+ /* */
2091
+ /* */
2092
+ /* */
2093
+ /* */
2094
+ /* */
2095
+ /* */
2096
+ /* */
2097
+ /* */
2098
+ /* */
2099
+ /* */
2100
+ /* */
2101
+ /* */
2102
+ /* */
2103
+ /* */
2104
+ /* */
2105
+ /* */
2106
+ /* */
2107
+ /* */
2108
+ /* */
2109
+ /* */
2110
+ /* */
2111
+ /* */
2112
+ /* */
2113
+ /* */
2114
+ /* */
2115
+ /* */
2116
+ /* */
2117
+ /* */
2118
+ /* */
2119
+ /* */
2120
+ /* */
2121
+ /* */
2122
+ /* */
2123
+ /* */
2124
+ /* */
2125
+ /* */
2126
+ /* */
2127
+ /* */
2128
+ /* */
2129
+ /* */
2130
+ /* */
2131
+ /* */
2132
+ /* */
2133
+ /* */
2134
+ /* */
2135
+ /* */
2136
+ /* */
2137
+ /* */
2138
+ /* */
2139
+ /* */
2140
+ /* */
2141
+ /* */
2142
+ /**
2143
+ * Quick fix for object values
2144
+ */
2145
+ values(obj) {
2146
+ if (_.isObject(obj) && !Array.isArray(obj)) {
2147
+ const values = [];
2148
+ for (const key in obj) {
2149
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
2150
+ values.push(obj[key]);
2151
+ }
2152
+ }
2153
+ return values;
2154
+ }
2155
+ return [];
2156
+ }
2157
+ }
2158
+ ;
2159
2159
  ({}); // @--end-of-file-for-module=tnp-core lib/helpers.ts
2160
2160
 
2161
- const CoreConfig = {
2162
- message: {
2163
- globalSystemToolMode: 'globalSystemToolMode'
2164
- }
2165
- };
2161
+ const CoreConfig = {
2162
+ message: {
2163
+ globalSystemToolMode: 'globalSystemToolMode'
2164
+ }
2165
+ };
2166
2166
  ({}); // @--end-of-file-for-module=tnp-core lib/core-config.ts
2167
2167
 
2168
- class PROGRESS_DATA {
2169
- constructor() {
2170
- this.type = 'event';
2171
- }
2172
- static log(log) {
2173
- /* */
2174
- /* */
2175
- /* */
2176
- /* */
2177
- }
2178
- static resolveFrom(chunk, callbackOnFounded, checkSplit = true) {
2179
- let progress;
2180
- let res = [];
2181
- if (!_.isString(chunk)) {
2182
- return [];
2183
- }
2184
- chunk = chunk.trim();
2185
- if (checkSplit) {
2186
- const split = chunk.split(/\r\n|\n|\r/);
2187
- if (split.length > 1) {
2188
- split.forEach(s => {
2189
- res = res.concat(this.resolveFrom(s, callbackOnFounded, false));
2190
- });
2191
- return res;
2192
- }
2193
- }
2194
- if (/\[\[\[.*\]\]\]/g.test(chunk)) {
2195
- chunk = chunk.replace(/^\[\[\[/g, '').replace(/\]\]\]$/g, '');
2196
- progress = chunk;
2197
- }
2198
- if (!_.isUndefined(progress)) {
2199
- try {
2200
- const p = JSON.parse(progress);
2201
- const single = _.merge(new PROGRESS_DATA(), p);
2202
- res = res.concat([single]);
2203
- if (_.isFunction(callbackOnFounded)) {
2204
- callbackOnFounded(single);
2205
- }
2206
- }
2207
- catch (err) {
2208
- Helpers.error(err, true, true);
2209
- Helpers.error(`ProgresssBarData: fail to parse "${progress}"`, true, true);
2210
- }
2211
- }
2212
- return res;
2213
- }
2214
- }
2215
- ;
2168
+ class PROGRESS_DATA {
2169
+ constructor() {
2170
+ this.type = 'event';
2171
+ }
2172
+ static log(log) {
2173
+ /* */
2174
+ /* */
2175
+ /* */
2176
+ /* */
2177
+ }
2178
+ static resolveFrom(chunk, callbackOnFounded, checkSplit = true) {
2179
+ let progress;
2180
+ let res = [];
2181
+ if (!_.isString(chunk)) {
2182
+ return [];
2183
+ }
2184
+ chunk = chunk.trim();
2185
+ if (checkSplit) {
2186
+ const split = chunk.split(/\r\n|\n|\r/);
2187
+ if (split.length > 1) {
2188
+ split.forEach(s => {
2189
+ res = res.concat(this.resolveFrom(s, callbackOnFounded, false));
2190
+ });
2191
+ return res;
2192
+ }
2193
+ }
2194
+ if (/\[\[\[.*\]\]\]/g.test(chunk)) {
2195
+ chunk = chunk.replace(/^\[\[\[/g, '').replace(/\]\]\]$/g, '');
2196
+ progress = chunk;
2197
+ }
2198
+ if (!_.isUndefined(progress)) {
2199
+ try {
2200
+ const p = JSON.parse(progress);
2201
+ const single = _.merge(new PROGRESS_DATA(), p);
2202
+ res = res.concat([single]);
2203
+ if (_.isFunction(callbackOnFounded)) {
2204
+ callbackOnFounded(single);
2205
+ }
2206
+ }
2207
+ catch (err) {
2208
+ Helpers.error(err, true, true);
2209
+ Helpers.error(`ProgresssBarData: fail to parse "${progress}"`, true, true);
2210
+ }
2211
+ }
2212
+ return res;
2213
+ }
2214
+ }
2215
+ ;
2216
2216
  ({}); // @--end-of-file-for-module=tnp-core lib/progress-data.ts
2217
2217
 
2218
- let Helpers = HelpersCore.InstanceCore;
2219
- ;
2218
+ let Helpers = HelpersCore.InstanceCore;
2219
+ ;
2220
2220
  ({}); // @--end-of-file-for-module=tnp-core lib/index.ts
2221
2221
 
2222
- /**
2223
- * Generated bundle index. Do not edit.
2222
+ /**
2223
+ * Generated bundle index. Do not edit.
2224
2224
  */
2225
2225
 
2226
2226
  export { CoreConfig, HelpersCore as CoreHelpers, Helpers, PROGRESS_DATA, crossPlatformPath, frameworkName, frameworkNameBe, path, win32Path };