tnp-core 13.1.17 → 13.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/app.d.ts +1 -1
- package/app.js +6 -6
- package/browser/README.md +24 -24
- package/browser/esm2020/lib/core-config.mjs +5 -5
- package/browser/esm2020/lib/core-imports.mjs +107 -107
- package/browser/esm2020/lib/core-models.mjs +1 -1
- package/browser/esm2020/lib/helpers-isomorphic.mjs +34 -53
- package/browser/esm2020/lib/helpers-messages.mjs +434 -434
- package/browser/esm2020/lib/helpers.mjs +939 -939
- package/browser/esm2020/lib/index.mjs +7 -7
- package/browser/esm2020/lib/progress-data.mjs +50 -50
- package/browser/esm2020/public-api.mjs +1 -1
- package/browser/esm2020/tnp-core.mjs +4 -4
- package/browser/fesm2015/tnp-core.mjs +1553 -1571
- package/browser/fesm2015/tnp-core.mjs.map +1 -1
- package/browser/fesm2020/tnp-core.mjs +1551 -1569
- package/browser/fesm2020/tnp-core.mjs.map +1 -1
- package/browser/lib/core-config.d.ts +5 -5
- package/browser/lib/core-imports.d.ts +6 -6
- package/browser/lib/core-models.d.ts +42 -42
- package/browser/lib/helpers-isomorphic.d.ts +6 -7
- package/browser/lib/helpers-messages.d.ts +11 -11
- package/browser/lib/helpers.d.ts +33 -33
- package/browser/lib/index.d.ts +7 -7
- package/browser/lib/progress-data.d.ts +18 -18
- package/browser/public-api.d.ts +1 -1
- package/browser/tnp-core.d.ts +5 -5
- package/client/README.md +24 -24
- package/client/esm2020/lib/core-config.mjs +5 -5
- package/client/esm2020/lib/core-imports.mjs +107 -107
- package/client/esm2020/lib/core-models.mjs +1 -1
- package/client/esm2020/lib/helpers-isomorphic.mjs +34 -53
- package/client/esm2020/lib/helpers-messages.mjs +434 -434
- package/client/esm2020/lib/helpers.mjs +939 -939
- package/client/esm2020/lib/index.mjs +7 -7
- package/client/esm2020/lib/progress-data.mjs +50 -50
- package/client/esm2020/public-api.mjs +1 -1
- package/client/esm2020/tnp-core.mjs +4 -4
- package/client/fesm2015/tnp-core.mjs +1553 -1571
- package/client/fesm2015/tnp-core.mjs.map +1 -1
- package/client/fesm2020/tnp-core.mjs +1551 -1569
- package/client/fesm2020/tnp-core.mjs.map +1 -1
- package/client/lib/core-config.d.ts +5 -5
- package/client/lib/core-imports.d.ts +6 -6
- package/client/lib/core-models.d.ts +42 -42
- package/client/lib/helpers-isomorphic.d.ts +6 -7
- package/client/lib/helpers-messages.d.ts +11 -11
- package/client/lib/helpers.d.ts +33 -33
- package/client/lib/index.d.ts +7 -7
- package/client/lib/progress-data.d.ts +18 -18
- package/client/public-api.d.ts +1 -1
- package/client/tnp-core.d.ts +5 -5
- package/index.d.ts +1 -1
- package/index.js +5 -5
- package/lib/core-config.d.ts +5 -5
- package/lib/core-config.js +9 -9
- package/lib/core-imports.d.ts +31 -31
- package/lib/core-imports.js +113 -113
- package/lib/core-models.d.ts +42 -42
- package/lib/core-models.js +3 -3
- package/lib/helpers-isomorphic.d.ts +6 -9
- package/lib/helpers-isomorphic.js +56 -74
- package/lib/helpers-isomorphic.js.map +1 -1
- package/lib/helpers-messages.d.ts +11 -11
- package/lib/helpers-messages.js +474 -474
- package/lib/helpers.d.ts +111 -111
- package/lib/helpers.js +1127 -1127
- package/lib/index.d.ts +7 -7
- package/lib/index.js +13 -13
- package/lib/progress-data.d.ts +18 -18
- package/lib/progress-data.js +59 -59
- package/lib/public-api.d.ts +7 -7
- package/lib/public-api.js +13 -13
- package/package.json +2 -2
- package/package.json_devDependencies.json +202 -202
- package/package.json_tnp.json5 +62 -62
- package/tmp-environment.json +13 -12
- package/websql/README.md +24 -24
- package/websql/esm2020/lib/core-config.mjs +5 -5
- package/websql/esm2020/lib/core-imports.mjs +108 -108
- package/websql/esm2020/lib/core-models.mjs +1 -1
- package/websql/esm2020/lib/helpers-isomorphic.mjs +35 -55
- package/websql/esm2020/lib/helpers-messages.mjs +434 -434
- package/websql/esm2020/lib/helpers.mjs +939 -939
- package/websql/esm2020/lib/index.mjs +7 -7
- package/websql/esm2020/lib/progress-data.mjs +50 -50
- package/websql/esm2020/public-api.mjs +1 -1
- package/websql/esm2020/tnp-core.mjs +4 -4
- package/websql/fesm2015/tnp-core.mjs +1548 -1567
- package/websql/fesm2015/tnp-core.mjs.map +1 -1
- package/websql/fesm2020/tnp-core.mjs +1546 -1565
- package/websql/fesm2020/tnp-core.mjs.map +1 -1
- package/websql/lib/core-config.d.ts +5 -5
- package/websql/lib/core-imports.d.ts +8 -8
- package/websql/lib/core-models.d.ts +42 -42
- package/websql/lib/helpers-isomorphic.d.ts +6 -9
- package/websql/lib/helpers-messages.d.ts +11 -11
- package/websql/lib/helpers.d.ts +33 -33
- package/websql/lib/index.d.ts +7 -7
- package/websql/lib/progress-data.d.ts +18 -18
- package/websql/public-api.d.ts +1 -1
- package/websql/tnp-core.d.ts +5 -5
package/lib/helpers-messages.js
CHANGED
@@ -1,474 +1,474 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.HelpersMessages = void 0;
|
4
|
-
var tslib_1 = require("tslib");
|
5
|
-
var core_imports_1 = require("./core-imports");
|
6
|
-
// import { config } from 'tnp-config';
|
7
|
-
// import { PROGRESS_DATA } from 'tnp-models';
|
8
|
-
var index_1 = require("./index");
|
9
|
-
var helpers_isomorphic_1 = require("./helpers-isomorphic");
|
10
|
-
var progress_data_1 = require("./progress-data");
|
11
|
-
// TODO handle global.testMode ?
|
12
|
-
var KEY = {
|
13
|
-
LAST_ERROR: Symbol(),
|
14
|
-
LAST_INFO: Symbol(),
|
15
|
-
LAST_WARN: Symbol(),
|
16
|
-
LAST_LOG: Symbol(),
|
17
|
-
LAST_SUCCESS: Symbol(),
|
18
|
-
LAST_TASK_STARTED: Symbol(),
|
19
|
-
LAST_TASK_DONE: Symbol(),
|
20
|
-
};
|
21
|
-
var KEY_COUNT = {
|
22
|
-
LAST_ERROR: Symbol(),
|
23
|
-
LAST_INFO: Symbol(),
|
24
|
-
LAST_WARN: Symbol(),
|
25
|
-
LAST_LOG: Symbol(),
|
26
|
-
LAST_SUCCESS: Symbol(),
|
27
|
-
LAST_TASK_STARTED: Symbol(),
|
28
|
-
LAST_TASK_DONE: Symbol(),
|
29
|
-
};
|
30
|
-
//#region @backend
|
31
|
-
global[KEY_COUNT.LAST_ERROR] = 0;
|
32
|
-
global[KEY_COUNT.LAST_INFO] = 0;
|
33
|
-
global[KEY_COUNT.LAST_WARN] = 0;
|
34
|
-
global[KEY_COUNT.LAST_LOG] = 0;
|
35
|
-
global[KEY_COUNT.LAST_SUCCESS] = 0;
|
36
|
-
global[KEY_COUNT.LAST_TASK_STARTED] = 0;
|
37
|
-
global[KEY_COUNT.LAST_TASK_DONE] = 0;
|
38
|
-
var useSpinner = global['spinnerInParentProcess'];
|
39
|
-
//#endregion
|
40
|
-
var LIMIT = 10;
|
41
|
-
// export class Log {
|
42
|
-
// private static _instance: Log;
|
43
|
-
// public Instance() {
|
44
|
-
// if (!Log._instance) {
|
45
|
-
// Log._instance = new Log();
|
46
|
-
// }
|
47
|
-
// return Log._instance;
|
48
|
-
// }
|
49
|
-
// create(name: string, level?: Level) {
|
50
|
-
// if (level === void 0) {
|
51
|
-
// level = Level.DATA;
|
52
|
-
// }
|
53
|
-
// return {
|
54
|
-
// d(details: string, debugLevel?: number) {
|
55
|
-
// return Helpers.log(`[${name}] ${details}`, debugLevel)
|
56
|
-
// },
|
57
|
-
// i(details: string) {
|
58
|
-
// return Helpers.info(`[${name}] ${details}`)
|
59
|
-
// },
|
60
|
-
// w(details: string, noExit = false, noTrace = false) {
|
61
|
-
// return Helpers.error(`[${name}] ${details}`, noExit, noTrace);
|
62
|
-
// },
|
63
|
-
// er(details: string, ) {
|
64
|
-
// return Helpers.info(`[${name}] ${details}`)
|
65
|
-
// },
|
66
|
-
// }
|
67
|
-
// }
|
68
|
-
// }
|
69
|
-
var HelpersMessages = /** @class */ (function (_super) {
|
70
|
-
tslib_1.__extends(HelpersMessages, _super);
|
71
|
-
function HelpersMessages() {
|
72
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
73
|
-
}
|
74
|
-
HelpersMessages.prototype.msgCacheClear = function () {
|
75
|
-
//#region @backend
|
76
|
-
global[KEY.LAST_LOG] = void 0;
|
77
|
-
global[KEY.LAST_WARN] = void 0;
|
78
|
-
global[KEY.LAST_ERROR] = void 0;
|
79
|
-
global[KEY.LAST_INFO] = void 0;
|
80
|
-
//#endregion
|
81
|
-
};
|
82
|
-
HelpersMessages.prototype.error = function (details, noExit, noTrace) {
|
83
|
-
if (noExit === void 0) { noExit = false; }
|
84
|
-
if (noTrace === void 0) { noTrace = false; }
|
85
|
-
//#region browser mode
|
86
|
-
if (index_1.Helpers.isBrowser) {
|
87
|
-
console.error(details);
|
88
|
-
return;
|
89
|
-
}
|
90
|
-
//#endregion
|
91
|
-
//#region @backend
|
92
|
-
// Error.stackTraceLimit = Infinity;
|
93
|
-
if (!global.globalSystemToolMode) {
|
94
|
-
noTrace = true;
|
95
|
-
}
|
96
|
-
details = transformData(details);
|
97
|
-
var display = function (dot) {
|
98
|
-
if (dot === void 0) { dot = false; }
|
99
|
-
if (global.tnpNonInteractive) {
|
100
|
-
progress_data_1.PROGRESS_DATA.log({ msg: dot ? '.' : details });
|
101
|
-
}
|
102
|
-
if (dot) {
|
103
|
-
process.stdout.write(core_imports_1.chalk.red('.'));
|
104
|
-
}
|
105
|
-
else {
|
106
|
-
if (useSpinner) {
|
107
|
-
process === null || process === void 0 ? void 0 : process.send("error::".concat(core_imports_1.chalk.red(details)));
|
108
|
-
}
|
109
|
-
else {
|
110
|
-
if (global.globalSystemToolMode) {
|
111
|
-
if (noTrace) {
|
112
|
-
!global.muteMessages && console.log(core_imports_1.chalk.red(details));
|
113
|
-
}
|
114
|
-
else {
|
115
|
-
!global.muteMessages && console.trace(core_imports_1.chalk.red(details));
|
116
|
-
}
|
117
|
-
if (!noExit) {
|
118
|
-
process.exit(1);
|
119
|
-
}
|
120
|
-
}
|
121
|
-
else {
|
122
|
-
console.log(details); // no formatiing debuggable code
|
123
|
-
}
|
124
|
-
}
|
125
|
-
}
|
126
|
-
};
|
127
|
-
if (global[KEY.LAST_ERROR] === details) {
|
128
|
-
global[KEY_COUNT.LAST_ERROR]++;
|
129
|
-
if (global[KEY_COUNT.LAST_ERROR] > LIMIT) {
|
130
|
-
display(true);
|
131
|
-
}
|
132
|
-
else {
|
133
|
-
display();
|
134
|
-
}
|
135
|
-
}
|
136
|
-
else {
|
137
|
-
global[KEY_COUNT.LAST_ERROR] = 0;
|
138
|
-
global[KEY.LAST_ERROR] = details;
|
139
|
-
display();
|
140
|
-
}
|
141
|
-
//#endregion
|
142
|
-
};
|
143
|
-
//#endregion
|
144
|
-
//#region info
|
145
|
-
HelpersMessages.prototype.info = function (details, repeatable) {
|
146
|
-
if (repeatable === void 0) { repeatable = false; }
|
147
|
-
// //#region @backend
|
148
|
-
// console.log({
|
149
|
-
// shouldDiaplyInfo: details,
|
150
|
-
// muteMessages: global.muteMessages,
|
151
|
-
// hideInfos: global.hideInfos,
|
152
|
-
// });
|
153
|
-
// //#endregion
|
154
|
-
if (index_1.Helpers.isBrowser) {
|
155
|
-
console.info(details);
|
156
|
-
return;
|
157
|
-
}
|
158
|
-
//#region @backend
|
159
|
-
var display = function (dot) {
|
160
|
-
if (dot === void 0) { dot = false; }
|
161
|
-
if (global.tnpNonInteractive) {
|
162
|
-
progress_data_1.PROGRESS_DATA.log({ msg: dot ? '.' : details, type: 'info' });
|
163
|
-
}
|
164
|
-
if (dot) {
|
165
|
-
process.stdout.write(core_imports_1.chalk.blue('.'));
|
166
|
-
}
|
167
|
-
else {
|
168
|
-
if (useSpinner) {
|
169
|
-
process === null || process === void 0 ? void 0 : process.send("info::".concat(core_imports_1.chalk.blue(details)));
|
170
|
-
}
|
171
|
-
else {
|
172
|
-
if (global.globalSystemToolMode) {
|
173
|
-
console.log(core_imports_1.chalk.blue(details));
|
174
|
-
}
|
175
|
-
else {
|
176
|
-
console.log(details);
|
177
|
-
}
|
178
|
-
}
|
179
|
-
}
|
180
|
-
};
|
181
|
-
if (!global.muteMessages && !global.hideInfos) {
|
182
|
-
if ((global[KEY.LAST_INFO] === details) && !repeatable) {
|
183
|
-
global[KEY_COUNT.LAST_INFO]++;
|
184
|
-
if (global[KEY_COUNT.LAST_INFO] > LIMIT) {
|
185
|
-
display(true);
|
186
|
-
}
|
187
|
-
else {
|
188
|
-
display();
|
189
|
-
}
|
190
|
-
}
|
191
|
-
else {
|
192
|
-
global[KEY_COUNT.LAST_INFO] = 0;
|
193
|
-
global[KEY.LAST_INFO] = details;
|
194
|
-
display();
|
195
|
-
}
|
196
|
-
}
|
197
|
-
//#endregion
|
198
|
-
};
|
199
|
-
//#endregion
|
200
|
-
//#region info
|
201
|
-
HelpersMessages.prototype.success = function (details) {
|
202
|
-
if (index_1.Helpers.isBrowser) {
|
203
|
-
console.info(details);
|
204
|
-
return;
|
205
|
-
}
|
206
|
-
//#region @backend
|
207
|
-
details = transformData(details);
|
208
|
-
var display = function (dot) {
|
209
|
-
if (dot === void 0) { dot = false; }
|
210
|
-
if (global.tnpNonInteractive) {
|
211
|
-
progress_data_1.PROGRESS_DATA.log({ msg: dot ? '.' : details, type: 'info' });
|
212
|
-
}
|
213
|
-
if (dot) {
|
214
|
-
process.stdout.write(core_imports_1.chalk.green('.'));
|
215
|
-
}
|
216
|
-
else {
|
217
|
-
if (useSpinner) {
|
218
|
-
process === null || process === void 0 ? void 0 : process.send("success::".concat(core_imports_1.chalk.green(details)));
|
219
|
-
}
|
220
|
-
else {
|
221
|
-
if (global.globalSystemToolMode) {
|
222
|
-
console.log(core_imports_1.chalk.green(details));
|
223
|
-
}
|
224
|
-
else {
|
225
|
-
console.log(details);
|
226
|
-
}
|
227
|
-
}
|
228
|
-
}
|
229
|
-
};
|
230
|
-
if (!global.muteMessages && !global.hideInfos) {
|
231
|
-
if ((global[KEY.LAST_SUCCESS] === details)) {
|
232
|
-
global[KEY_COUNT.LAST_SUCCESS]++;
|
233
|
-
if (global[KEY_COUNT.LAST_SUCCESS] > LIMIT) {
|
234
|
-
display(true);
|
235
|
-
}
|
236
|
-
else {
|
237
|
-
display();
|
238
|
-
}
|
239
|
-
}
|
240
|
-
else {
|
241
|
-
global[KEY_COUNT.LAST_SUCCESS] = 0;
|
242
|
-
global[KEY.LAST_SUCCESS] = details;
|
243
|
-
display();
|
244
|
-
}
|
245
|
-
}
|
246
|
-
//#endregion
|
247
|
-
};
|
248
|
-
//#endregion
|
249
|
-
HelpersMessages.prototype.taskStarted = function (details) {
|
250
|
-
if (index_1.Helpers.isBrowser) {
|
251
|
-
console.info(details);
|
252
|
-
return;
|
253
|
-
}
|
254
|
-
//#region @backend
|
255
|
-
details = transformData(details);
|
256
|
-
var display = function (dot) {
|
257
|
-
if (dot === void 0) { dot = false; }
|
258
|
-
if (global.tnpNonInteractive) {
|
259
|
-
progress_data_1.PROGRESS_DATA.log({ msg: dot ? '.' : details, type: 'info' });
|
260
|
-
}
|
261
|
-
if (dot) {
|
262
|
-
process.stdout.write(core_imports_1.chalk.magenta('.'));
|
263
|
-
}
|
264
|
-
else {
|
265
|
-
if (useSpinner) {
|
266
|
-
process === null || process === void 0 ? void 0 : process.send("taskstart::\u25BA ".concat(core_imports_1.chalk.magenta(details)));
|
267
|
-
}
|
268
|
-
else {
|
269
|
-
if (global.globalSystemToolMode) {
|
270
|
-
console.log('- ' + core_imports_1.chalk.magenta(details));
|
271
|
-
}
|
272
|
-
else {
|
273
|
-
console.log(details);
|
274
|
-
}
|
275
|
-
}
|
276
|
-
}
|
277
|
-
};
|
278
|
-
if (!global.muteMessages && !global.hideInfos) {
|
279
|
-
if ((global[KEY.LAST_TASK_STARTED] === details)) {
|
280
|
-
global[KEY_COUNT.LAST_TASK_STARTED]++;
|
281
|
-
if (global[KEY_COUNT.LAST_TASK_STARTED] > LIMIT) {
|
282
|
-
display(true);
|
283
|
-
}
|
284
|
-
else {
|
285
|
-
display();
|
286
|
-
}
|
287
|
-
}
|
288
|
-
else {
|
289
|
-
global[KEY_COUNT.LAST_TASK_STARTED] = 0;
|
290
|
-
global[KEY.LAST_TASK_STARTED] = details;
|
291
|
-
display();
|
292
|
-
}
|
293
|
-
}
|
294
|
-
//#endregion
|
295
|
-
};
|
296
|
-
//#endregion
|
297
|
-
HelpersMessages.prototype.taskDone = function (details) {
|
298
|
-
if (index_1.Helpers.isBrowser) {
|
299
|
-
console.info(details);
|
300
|
-
return;
|
301
|
-
}
|
302
|
-
//#region @backend
|
303
|
-
if (!details) {
|
304
|
-
var lastStatedTask = global[KEY.LAST_TASK_STARTED];
|
305
|
-
details = lastStatedTask;
|
306
|
-
}
|
307
|
-
details = transformData(details);
|
308
|
-
var display = function (dot) {
|
309
|
-
if (dot === void 0) { dot = false; }
|
310
|
-
if (global.tnpNonInteractive) {
|
311
|
-
progress_data_1.PROGRESS_DATA.log({ msg: dot ? '.' : details, type: 'info' });
|
312
|
-
}
|
313
|
-
if (dot) {
|
314
|
-
process.stdout.write(core_imports_1.chalk.green('.'));
|
315
|
-
}
|
316
|
-
else {
|
317
|
-
if (useSpinner) {
|
318
|
-
process === null || process === void 0 ? void 0 : process.send("taskdone::\u2713 ".concat(core_imports_1.chalk.green(details)));
|
319
|
-
}
|
320
|
-
else {
|
321
|
-
if (global.globalSystemToolMode) {
|
322
|
-
console.log('\u2713 ' + core_imports_1.chalk.green(details));
|
323
|
-
}
|
324
|
-
else {
|
325
|
-
console.log(details);
|
326
|
-
}
|
327
|
-
}
|
328
|
-
}
|
329
|
-
};
|
330
|
-
if (!global.muteMessages && !global.hideInfos) {
|
331
|
-
if ((global[KEY.LAST_TASK_DONE] === details)) {
|
332
|
-
global[KEY_COUNT.LAST_TASK_DONE]++;
|
333
|
-
if (global[KEY_COUNT.LAST_TASK_DONE] > LIMIT) {
|
334
|
-
display(true);
|
335
|
-
}
|
336
|
-
else {
|
337
|
-
display();
|
338
|
-
}
|
339
|
-
}
|
340
|
-
else {
|
341
|
-
global[KEY_COUNT.LAST_TASK_DONE] = 0;
|
342
|
-
global[KEY.LAST_TASK_DONE] = details;
|
343
|
-
display();
|
344
|
-
}
|
345
|
-
}
|
346
|
-
//#endregion
|
347
|
-
};
|
348
|
-
//#endregion
|
349
|
-
//#region log
|
350
|
-
HelpersMessages.prototype.log = function (details, debugLevel) {
|
351
|
-
if (debugLevel === void 0) { debugLevel = 0; }
|
352
|
-
if (index_1.Helpers.isBrowser) {
|
353
|
-
console.log(details);
|
354
|
-
return;
|
355
|
-
}
|
356
|
-
//#region @backend
|
357
|
-
if (debugLevel > (global.verboseLevel || 0)) {
|
358
|
-
return;
|
359
|
-
}
|
360
|
-
details = transformData(details);
|
361
|
-
var display = function (dot) {
|
362
|
-
if (dot === void 0) { dot = false; }
|
363
|
-
if (global.tnpNonInteractive) {
|
364
|
-
progress_data_1.PROGRESS_DATA.log({ msg: dot ? '.' : details });
|
365
|
-
}
|
366
|
-
if (dot) {
|
367
|
-
process.stdout.write('.');
|
368
|
-
}
|
369
|
-
else {
|
370
|
-
if (useSpinner) {
|
371
|
-
process === null || process === void 0 ? void 0 : process.send("log::".concat(core_imports_1.chalk.black(details)));
|
372
|
-
}
|
373
|
-
else {
|
374
|
-
if (global.globalSystemToolMode) {
|
375
|
-
console.log(core_imports_1.chalk.black(details));
|
376
|
-
}
|
377
|
-
else {
|
378
|
-
console.log(details);
|
379
|
-
}
|
380
|
-
}
|
381
|
-
}
|
382
|
-
};
|
383
|
-
if ((!global.muteMessages && !global.hideLog)) {
|
384
|
-
if (global[KEY.LAST_LOG] === details) {
|
385
|
-
global[KEY_COUNT.LAST_LOG]++;
|
386
|
-
if (global[KEY_COUNT.LAST_LOG] > LIMIT) {
|
387
|
-
display(true);
|
388
|
-
}
|
389
|
-
else {
|
390
|
-
display();
|
391
|
-
}
|
392
|
-
}
|
393
|
-
else {
|
394
|
-
global[KEY_COUNT.LAST_LOG] = 0;
|
395
|
-
global[KEY.LAST_LOG] = details;
|
396
|
-
display();
|
397
|
-
}
|
398
|
-
}
|
399
|
-
//#endregion
|
400
|
-
};
|
401
|
-
//#endregion
|
402
|
-
//#region warn
|
403
|
-
HelpersMessages.prototype.warn = function (details, trace) {
|
404
|
-
if (trace === void 0) { trace = false; }
|
405
|
-
if (index_1.Helpers.isBrowser) {
|
406
|
-
console.warn(details);
|
407
|
-
return;
|
408
|
-
}
|
409
|
-
//#region @backend
|
410
|
-
var display = function (dot) {
|
411
|
-
if (dot === void 0) { dot = false; }
|
412
|
-
if (global.tnpNonInteractive) {
|
413
|
-
progress_data_1.PROGRESS_DATA.log({ msg: dot ? '.' : details, type: 'warning' });
|
414
|
-
}
|
415
|
-
if (dot) {
|
416
|
-
process.stdout.write(core_imports_1.chalk.yellow('.'));
|
417
|
-
}
|
418
|
-
else {
|
419
|
-
if (useSpinner) {
|
420
|
-
process === null || process === void 0 ? void 0 : process.send("warn::".concat(core_imports_1.chalk.yellow(details)));
|
421
|
-
}
|
422
|
-
else {
|
423
|
-
if (global.globalSystemToolMode) {
|
424
|
-
if (trace) {
|
425
|
-
(!global.muteMessages && !global.hideWarnings) && console.trace(core_imports_1.chalk.yellow(details));
|
426
|
-
}
|
427
|
-
else {
|
428
|
-
(!global.muteMessages && !global.hideWarnings) && console.log(core_imports_1.chalk.yellow(details));
|
429
|
-
}
|
430
|
-
}
|
431
|
-
else {
|
432
|
-
if (trace) {
|
433
|
-
(!global.muteMessages && !global.hideWarnings) && console.trace(details);
|
434
|
-
}
|
435
|
-
else {
|
436
|
-
(!global.muteMessages && !global.hideWarnings) && console.log(details);
|
437
|
-
}
|
438
|
-
}
|
439
|
-
}
|
440
|
-
}
|
441
|
-
};
|
442
|
-
if (global[KEY.LAST_WARN] === details) {
|
443
|
-
global[KEY_COUNT.LAST_WARN]++;
|
444
|
-
if (global[KEY_COUNT.LAST_WARN] > LIMIT) {
|
445
|
-
display(true);
|
446
|
-
}
|
447
|
-
else {
|
448
|
-
display();
|
449
|
-
}
|
450
|
-
}
|
451
|
-
else {
|
452
|
-
global[KEY_COUNT.LAST_WARN] = 0;
|
453
|
-
global[KEY.LAST_WARN] = details;
|
454
|
-
display();
|
455
|
-
}
|
456
|
-
//#endregion
|
457
|
-
};
|
458
|
-
return HelpersMessages;
|
459
|
-
}(helpers_isomorphic_1.HelpersIsomorphic));
|
460
|
-
exports.HelpersMessages = HelpersMessages;
|
461
|
-
function transformData(details) {
|
462
|
-
if (typeof details === 'object') {
|
463
|
-
if (Array.isArray(details)) {
|
464
|
-
return details.join('\n');
|
465
|
-
}
|
466
|
-
try {
|
467
|
-
var json = JSON.stringify(details);
|
468
|
-
details = json;
|
469
|
-
}
|
470
|
-
catch (error) { }
|
471
|
-
}
|
472
|
-
return details;
|
473
|
-
}
|
474
|
-
//# sourceMappingURL
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.HelpersMessages = void 0;
|
4
|
+
var tslib_1 = require("tslib");
|
5
|
+
var core_imports_1 = require("./core-imports");
|
6
|
+
// import { config } from 'tnp-config';
|
7
|
+
// import { PROGRESS_DATA } from 'tnp-models';
|
8
|
+
var index_1 = require("./index");
|
9
|
+
var helpers_isomorphic_1 = require("./helpers-isomorphic");
|
10
|
+
var progress_data_1 = require("./progress-data");
|
11
|
+
// TODO handle global.testMode ?
|
12
|
+
var KEY = {
|
13
|
+
LAST_ERROR: Symbol(),
|
14
|
+
LAST_INFO: Symbol(),
|
15
|
+
LAST_WARN: Symbol(),
|
16
|
+
LAST_LOG: Symbol(),
|
17
|
+
LAST_SUCCESS: Symbol(),
|
18
|
+
LAST_TASK_STARTED: Symbol(),
|
19
|
+
LAST_TASK_DONE: Symbol(),
|
20
|
+
};
|
21
|
+
var KEY_COUNT = {
|
22
|
+
LAST_ERROR: Symbol(),
|
23
|
+
LAST_INFO: Symbol(),
|
24
|
+
LAST_WARN: Symbol(),
|
25
|
+
LAST_LOG: Symbol(),
|
26
|
+
LAST_SUCCESS: Symbol(),
|
27
|
+
LAST_TASK_STARTED: Symbol(),
|
28
|
+
LAST_TASK_DONE: Symbol(),
|
29
|
+
};
|
30
|
+
//#region @backend
|
31
|
+
global[KEY_COUNT.LAST_ERROR] = 0;
|
32
|
+
global[KEY_COUNT.LAST_INFO] = 0;
|
33
|
+
global[KEY_COUNT.LAST_WARN] = 0;
|
34
|
+
global[KEY_COUNT.LAST_LOG] = 0;
|
35
|
+
global[KEY_COUNT.LAST_SUCCESS] = 0;
|
36
|
+
global[KEY_COUNT.LAST_TASK_STARTED] = 0;
|
37
|
+
global[KEY_COUNT.LAST_TASK_DONE] = 0;
|
38
|
+
var useSpinner = global['spinnerInParentProcess'];
|
39
|
+
//#endregion
|
40
|
+
var LIMIT = 10;
|
41
|
+
// export class Log {
|
42
|
+
// private static _instance: Log;
|
43
|
+
// public Instance() {
|
44
|
+
// if (!Log._instance) {
|
45
|
+
// Log._instance = new Log();
|
46
|
+
// }
|
47
|
+
// return Log._instance;
|
48
|
+
// }
|
49
|
+
// create(name: string, level?: Level) {
|
50
|
+
// if (level === void 0) {
|
51
|
+
// level = Level.DATA;
|
52
|
+
// }
|
53
|
+
// return {
|
54
|
+
// d(details: string, debugLevel?: number) {
|
55
|
+
// return Helpers.log(`[${name}] ${details}`, debugLevel)
|
56
|
+
// },
|
57
|
+
// i(details: string) {
|
58
|
+
// return Helpers.info(`[${name}] ${details}`)
|
59
|
+
// },
|
60
|
+
// w(details: string, noExit = false, noTrace = false) {
|
61
|
+
// return Helpers.error(`[${name}] ${details}`, noExit, noTrace);
|
62
|
+
// },
|
63
|
+
// er(details: string, ) {
|
64
|
+
// return Helpers.info(`[${name}] ${details}`)
|
65
|
+
// },
|
66
|
+
// }
|
67
|
+
// }
|
68
|
+
// }
|
69
|
+
var HelpersMessages = /** @class */ (function (_super) {
|
70
|
+
tslib_1.__extends(HelpersMessages, _super);
|
71
|
+
function HelpersMessages() {
|
72
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
73
|
+
}
|
74
|
+
HelpersMessages.prototype.msgCacheClear = function () {
|
75
|
+
//#region @backend
|
76
|
+
global[KEY.LAST_LOG] = void 0;
|
77
|
+
global[KEY.LAST_WARN] = void 0;
|
78
|
+
global[KEY.LAST_ERROR] = void 0;
|
79
|
+
global[KEY.LAST_INFO] = void 0;
|
80
|
+
//#endregion
|
81
|
+
};
|
82
|
+
HelpersMessages.prototype.error = function (details, noExit, noTrace) {
|
83
|
+
if (noExit === void 0) { noExit = false; }
|
84
|
+
if (noTrace === void 0) { noTrace = false; }
|
85
|
+
//#region browser mode
|
86
|
+
if (index_1.Helpers.isBrowser) {
|
87
|
+
console.error(details);
|
88
|
+
return;
|
89
|
+
}
|
90
|
+
//#endregion
|
91
|
+
//#region @backend
|
92
|
+
// Error.stackTraceLimit = Infinity;
|
93
|
+
if (!global.globalSystemToolMode) {
|
94
|
+
noTrace = true;
|
95
|
+
}
|
96
|
+
details = transformData(details);
|
97
|
+
var display = function (dot) {
|
98
|
+
if (dot === void 0) { dot = false; }
|
99
|
+
if (global.tnpNonInteractive) {
|
100
|
+
progress_data_1.PROGRESS_DATA.log({ msg: dot ? '.' : details });
|
101
|
+
}
|
102
|
+
if (dot) {
|
103
|
+
process.stdout.write(core_imports_1.chalk.red('.'));
|
104
|
+
}
|
105
|
+
else {
|
106
|
+
if (useSpinner) {
|
107
|
+
process === null || process === void 0 ? void 0 : process.send("error::".concat(core_imports_1.chalk.red(details)));
|
108
|
+
}
|
109
|
+
else {
|
110
|
+
if (global.globalSystemToolMode) {
|
111
|
+
if (noTrace) {
|
112
|
+
!global.muteMessages && console.log(core_imports_1.chalk.red(details));
|
113
|
+
}
|
114
|
+
else {
|
115
|
+
!global.muteMessages && console.trace(core_imports_1.chalk.red(details));
|
116
|
+
}
|
117
|
+
if (!noExit) {
|
118
|
+
process.exit(1);
|
119
|
+
}
|
120
|
+
}
|
121
|
+
else {
|
122
|
+
console.log(details); // no formatiing debuggable code
|
123
|
+
}
|
124
|
+
}
|
125
|
+
}
|
126
|
+
};
|
127
|
+
if (global[KEY.LAST_ERROR] === details) {
|
128
|
+
global[KEY_COUNT.LAST_ERROR]++;
|
129
|
+
if (global[KEY_COUNT.LAST_ERROR] > LIMIT) {
|
130
|
+
display(true);
|
131
|
+
}
|
132
|
+
else {
|
133
|
+
display();
|
134
|
+
}
|
135
|
+
}
|
136
|
+
else {
|
137
|
+
global[KEY_COUNT.LAST_ERROR] = 0;
|
138
|
+
global[KEY.LAST_ERROR] = details;
|
139
|
+
display();
|
140
|
+
}
|
141
|
+
//#endregion
|
142
|
+
};
|
143
|
+
//#endregion
|
144
|
+
//#region info
|
145
|
+
HelpersMessages.prototype.info = function (details, repeatable) {
|
146
|
+
if (repeatable === void 0) { repeatable = false; }
|
147
|
+
// //#region @backend
|
148
|
+
// console.log({
|
149
|
+
// shouldDiaplyInfo: details,
|
150
|
+
// muteMessages: global.muteMessages,
|
151
|
+
// hideInfos: global.hideInfos,
|
152
|
+
// });
|
153
|
+
// //#endregion
|
154
|
+
if (index_1.Helpers.isBrowser) {
|
155
|
+
console.info(details);
|
156
|
+
return;
|
157
|
+
}
|
158
|
+
//#region @backend
|
159
|
+
var display = function (dot) {
|
160
|
+
if (dot === void 0) { dot = false; }
|
161
|
+
if (global.tnpNonInteractive) {
|
162
|
+
progress_data_1.PROGRESS_DATA.log({ msg: dot ? '.' : details, type: 'info' });
|
163
|
+
}
|
164
|
+
if (dot) {
|
165
|
+
process.stdout.write(core_imports_1.chalk.blue('.'));
|
166
|
+
}
|
167
|
+
else {
|
168
|
+
if (useSpinner) {
|
169
|
+
process === null || process === void 0 ? void 0 : process.send("info::".concat(core_imports_1.chalk.blue(details)));
|
170
|
+
}
|
171
|
+
else {
|
172
|
+
if (global.globalSystemToolMode) {
|
173
|
+
console.log(core_imports_1.chalk.blue(details));
|
174
|
+
}
|
175
|
+
else {
|
176
|
+
console.log(details);
|
177
|
+
}
|
178
|
+
}
|
179
|
+
}
|
180
|
+
};
|
181
|
+
if (!global.muteMessages && !global.hideInfos) {
|
182
|
+
if ((global[KEY.LAST_INFO] === details) && !repeatable) {
|
183
|
+
global[KEY_COUNT.LAST_INFO]++;
|
184
|
+
if (global[KEY_COUNT.LAST_INFO] > LIMIT) {
|
185
|
+
display(true);
|
186
|
+
}
|
187
|
+
else {
|
188
|
+
display();
|
189
|
+
}
|
190
|
+
}
|
191
|
+
else {
|
192
|
+
global[KEY_COUNT.LAST_INFO] = 0;
|
193
|
+
global[KEY.LAST_INFO] = details;
|
194
|
+
display();
|
195
|
+
}
|
196
|
+
}
|
197
|
+
//#endregion
|
198
|
+
};
|
199
|
+
//#endregion
|
200
|
+
//#region info
|
201
|
+
HelpersMessages.prototype.success = function (details) {
|
202
|
+
if (index_1.Helpers.isBrowser) {
|
203
|
+
console.info(details);
|
204
|
+
return;
|
205
|
+
}
|
206
|
+
//#region @backend
|
207
|
+
details = transformData(details);
|
208
|
+
var display = function (dot) {
|
209
|
+
if (dot === void 0) { dot = false; }
|
210
|
+
if (global.tnpNonInteractive) {
|
211
|
+
progress_data_1.PROGRESS_DATA.log({ msg: dot ? '.' : details, type: 'info' });
|
212
|
+
}
|
213
|
+
if (dot) {
|
214
|
+
process.stdout.write(core_imports_1.chalk.green('.'));
|
215
|
+
}
|
216
|
+
else {
|
217
|
+
if (useSpinner) {
|
218
|
+
process === null || process === void 0 ? void 0 : process.send("success::".concat(core_imports_1.chalk.green(details)));
|
219
|
+
}
|
220
|
+
else {
|
221
|
+
if (global.globalSystemToolMode) {
|
222
|
+
console.log(core_imports_1.chalk.green(details));
|
223
|
+
}
|
224
|
+
else {
|
225
|
+
console.log(details);
|
226
|
+
}
|
227
|
+
}
|
228
|
+
}
|
229
|
+
};
|
230
|
+
if (!global.muteMessages && !global.hideInfos) {
|
231
|
+
if ((global[KEY.LAST_SUCCESS] === details)) {
|
232
|
+
global[KEY_COUNT.LAST_SUCCESS]++;
|
233
|
+
if (global[KEY_COUNT.LAST_SUCCESS] > LIMIT) {
|
234
|
+
display(true);
|
235
|
+
}
|
236
|
+
else {
|
237
|
+
display();
|
238
|
+
}
|
239
|
+
}
|
240
|
+
else {
|
241
|
+
global[KEY_COUNT.LAST_SUCCESS] = 0;
|
242
|
+
global[KEY.LAST_SUCCESS] = details;
|
243
|
+
display();
|
244
|
+
}
|
245
|
+
}
|
246
|
+
//#endregion
|
247
|
+
};
|
248
|
+
//#endregion
|
249
|
+
HelpersMessages.prototype.taskStarted = function (details) {
|
250
|
+
if (index_1.Helpers.isBrowser) {
|
251
|
+
console.info(details);
|
252
|
+
return;
|
253
|
+
}
|
254
|
+
//#region @backend
|
255
|
+
details = transformData(details);
|
256
|
+
var display = function (dot) {
|
257
|
+
if (dot === void 0) { dot = false; }
|
258
|
+
if (global.tnpNonInteractive) {
|
259
|
+
progress_data_1.PROGRESS_DATA.log({ msg: dot ? '.' : details, type: 'info' });
|
260
|
+
}
|
261
|
+
if (dot) {
|
262
|
+
process.stdout.write(core_imports_1.chalk.magenta('.'));
|
263
|
+
}
|
264
|
+
else {
|
265
|
+
if (useSpinner) {
|
266
|
+
process === null || process === void 0 ? void 0 : process.send("taskstart::\u25BA ".concat(core_imports_1.chalk.magenta(details)));
|
267
|
+
}
|
268
|
+
else {
|
269
|
+
if (global.globalSystemToolMode) {
|
270
|
+
console.log('- ' + core_imports_1.chalk.magenta(details));
|
271
|
+
}
|
272
|
+
else {
|
273
|
+
console.log(details);
|
274
|
+
}
|
275
|
+
}
|
276
|
+
}
|
277
|
+
};
|
278
|
+
if (!global.muteMessages && !global.hideInfos) {
|
279
|
+
if ((global[KEY.LAST_TASK_STARTED] === details)) {
|
280
|
+
global[KEY_COUNT.LAST_TASK_STARTED]++;
|
281
|
+
if (global[KEY_COUNT.LAST_TASK_STARTED] > LIMIT) {
|
282
|
+
display(true);
|
283
|
+
}
|
284
|
+
else {
|
285
|
+
display();
|
286
|
+
}
|
287
|
+
}
|
288
|
+
else {
|
289
|
+
global[KEY_COUNT.LAST_TASK_STARTED] = 0;
|
290
|
+
global[KEY.LAST_TASK_STARTED] = details;
|
291
|
+
display();
|
292
|
+
}
|
293
|
+
}
|
294
|
+
//#endregion
|
295
|
+
};
|
296
|
+
//#endregion
|
297
|
+
HelpersMessages.prototype.taskDone = function (details) {
|
298
|
+
if (index_1.Helpers.isBrowser) {
|
299
|
+
console.info(details);
|
300
|
+
return;
|
301
|
+
}
|
302
|
+
//#region @backend
|
303
|
+
if (!details) {
|
304
|
+
var lastStatedTask = global[KEY.LAST_TASK_STARTED];
|
305
|
+
details = lastStatedTask;
|
306
|
+
}
|
307
|
+
details = transformData(details);
|
308
|
+
var display = function (dot) {
|
309
|
+
if (dot === void 0) { dot = false; }
|
310
|
+
if (global.tnpNonInteractive) {
|
311
|
+
progress_data_1.PROGRESS_DATA.log({ msg: dot ? '.' : details, type: 'info' });
|
312
|
+
}
|
313
|
+
if (dot) {
|
314
|
+
process.stdout.write(core_imports_1.chalk.green('.'));
|
315
|
+
}
|
316
|
+
else {
|
317
|
+
if (useSpinner) {
|
318
|
+
process === null || process === void 0 ? void 0 : process.send("taskdone::\u2713 ".concat(core_imports_1.chalk.green(details)));
|
319
|
+
}
|
320
|
+
else {
|
321
|
+
if (global.globalSystemToolMode) {
|
322
|
+
console.log('\u2713 ' + core_imports_1.chalk.green(details));
|
323
|
+
}
|
324
|
+
else {
|
325
|
+
console.log(details);
|
326
|
+
}
|
327
|
+
}
|
328
|
+
}
|
329
|
+
};
|
330
|
+
if (!global.muteMessages && !global.hideInfos) {
|
331
|
+
if ((global[KEY.LAST_TASK_DONE] === details)) {
|
332
|
+
global[KEY_COUNT.LAST_TASK_DONE]++;
|
333
|
+
if (global[KEY_COUNT.LAST_TASK_DONE] > LIMIT) {
|
334
|
+
display(true);
|
335
|
+
}
|
336
|
+
else {
|
337
|
+
display();
|
338
|
+
}
|
339
|
+
}
|
340
|
+
else {
|
341
|
+
global[KEY_COUNT.LAST_TASK_DONE] = 0;
|
342
|
+
global[KEY.LAST_TASK_DONE] = details;
|
343
|
+
display();
|
344
|
+
}
|
345
|
+
}
|
346
|
+
//#endregion
|
347
|
+
};
|
348
|
+
//#endregion
|
349
|
+
//#region log
|
350
|
+
HelpersMessages.prototype.log = function (details, debugLevel) {
|
351
|
+
if (debugLevel === void 0) { debugLevel = 0; }
|
352
|
+
if (index_1.Helpers.isBrowser) {
|
353
|
+
console.log(details);
|
354
|
+
return;
|
355
|
+
}
|
356
|
+
//#region @backend
|
357
|
+
if (debugLevel > (global.verboseLevel || 0)) {
|
358
|
+
return;
|
359
|
+
}
|
360
|
+
details = transformData(details);
|
361
|
+
var display = function (dot) {
|
362
|
+
if (dot === void 0) { dot = false; }
|
363
|
+
if (global.tnpNonInteractive) {
|
364
|
+
progress_data_1.PROGRESS_DATA.log({ msg: dot ? '.' : details });
|
365
|
+
}
|
366
|
+
if (dot) {
|
367
|
+
process.stdout.write('.');
|
368
|
+
}
|
369
|
+
else {
|
370
|
+
if (useSpinner) {
|
371
|
+
process === null || process === void 0 ? void 0 : process.send("log::".concat(core_imports_1.chalk.black(details)));
|
372
|
+
}
|
373
|
+
else {
|
374
|
+
if (global.globalSystemToolMode) {
|
375
|
+
console.log(core_imports_1.chalk.black(details));
|
376
|
+
}
|
377
|
+
else {
|
378
|
+
console.log(details);
|
379
|
+
}
|
380
|
+
}
|
381
|
+
}
|
382
|
+
};
|
383
|
+
if ((!global.muteMessages && !global.hideLog)) {
|
384
|
+
if (global[KEY.LAST_LOG] === details) {
|
385
|
+
global[KEY_COUNT.LAST_LOG]++;
|
386
|
+
if (global[KEY_COUNT.LAST_LOG] > LIMIT) {
|
387
|
+
display(true);
|
388
|
+
}
|
389
|
+
else {
|
390
|
+
display();
|
391
|
+
}
|
392
|
+
}
|
393
|
+
else {
|
394
|
+
global[KEY_COUNT.LAST_LOG] = 0;
|
395
|
+
global[KEY.LAST_LOG] = details;
|
396
|
+
display();
|
397
|
+
}
|
398
|
+
}
|
399
|
+
//#endregion
|
400
|
+
};
|
401
|
+
//#endregion
|
402
|
+
//#region warn
|
403
|
+
HelpersMessages.prototype.warn = function (details, trace) {
|
404
|
+
if (trace === void 0) { trace = false; }
|
405
|
+
if (index_1.Helpers.isBrowser) {
|
406
|
+
console.warn(details);
|
407
|
+
return;
|
408
|
+
}
|
409
|
+
//#region @backend
|
410
|
+
var display = function (dot) {
|
411
|
+
if (dot === void 0) { dot = false; }
|
412
|
+
if (global.tnpNonInteractive) {
|
413
|
+
progress_data_1.PROGRESS_DATA.log({ msg: dot ? '.' : details, type: 'warning' });
|
414
|
+
}
|
415
|
+
if (dot) {
|
416
|
+
process.stdout.write(core_imports_1.chalk.yellow('.'));
|
417
|
+
}
|
418
|
+
else {
|
419
|
+
if (useSpinner) {
|
420
|
+
process === null || process === void 0 ? void 0 : process.send("warn::".concat(core_imports_1.chalk.yellow(details)));
|
421
|
+
}
|
422
|
+
else {
|
423
|
+
if (global.globalSystemToolMode) {
|
424
|
+
if (trace) {
|
425
|
+
(!global.muteMessages && !global.hideWarnings) && console.trace(core_imports_1.chalk.yellow(details));
|
426
|
+
}
|
427
|
+
else {
|
428
|
+
(!global.muteMessages && !global.hideWarnings) && console.log(core_imports_1.chalk.yellow(details));
|
429
|
+
}
|
430
|
+
}
|
431
|
+
else {
|
432
|
+
if (trace) {
|
433
|
+
(!global.muteMessages && !global.hideWarnings) && console.trace(details);
|
434
|
+
}
|
435
|
+
else {
|
436
|
+
(!global.muteMessages && !global.hideWarnings) && console.log(details);
|
437
|
+
}
|
438
|
+
}
|
439
|
+
}
|
440
|
+
}
|
441
|
+
};
|
442
|
+
if (global[KEY.LAST_WARN] === details) {
|
443
|
+
global[KEY_COUNT.LAST_WARN]++;
|
444
|
+
if (global[KEY_COUNT.LAST_WARN] > LIMIT) {
|
445
|
+
display(true);
|
446
|
+
}
|
447
|
+
else {
|
448
|
+
display();
|
449
|
+
}
|
450
|
+
}
|
451
|
+
else {
|
452
|
+
global[KEY_COUNT.LAST_WARN] = 0;
|
453
|
+
global[KEY.LAST_WARN] = details;
|
454
|
+
display();
|
455
|
+
}
|
456
|
+
//#endregion
|
457
|
+
};
|
458
|
+
return HelpersMessages;
|
459
|
+
}(helpers_isomorphic_1.HelpersIsomorphic));
|
460
|
+
exports.HelpersMessages = HelpersMessages;
|
461
|
+
function transformData(details) {
|
462
|
+
if (typeof details === 'object') {
|
463
|
+
if (Array.isArray(details)) {
|
464
|
+
return details.join('\n');
|
465
|
+
}
|
466
|
+
try {
|
467
|
+
var json = JSON.stringify(details);
|
468
|
+
details = json;
|
469
|
+
}
|
470
|
+
catch (error) { }
|
471
|
+
}
|
472
|
+
return details;
|
473
|
+
}
|
474
|
+
//# sourceMappingURL=/Users/dfilipiak/projects/npm/tnp-core/tmp-bundle-release/bundle/project/tnp-core/bundle-nocutsrc/lib/helpers-messages.js.map
|