@alterior/logging 3.13.3 → 3.14.0
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/dist/index.d.ts +4 -4
- package/dist/index.js +7 -7
- package/dist/inspect.d.ts +28 -28
- package/dist/inspect.js +344 -345
- package/dist/inspect.js.map +1 -1
- package/dist/inspect.test.d.ts +1 -1
- package/dist/logger.d.ts +145 -145
- package/dist/logger.js +331 -331
- package/dist/logger.js.map +1 -1
- package/dist/logger.test.d.ts +1 -1
- package/dist/logger.test.js.map +1 -1
- package/dist/logging.module.d.ts +17 -17
- package/dist/logging.module.js +28 -28
- package/dist/logging.module.js.map +1 -1
- package/dist/test.d.ts +1 -1
- package/dist/trace.d.ts +60 -60
- package/dist/trace.js +214 -215
- package/dist/trace.js.map +1 -1
- package/dist/trace.test.d.ts +1 -1
- package/dist/trace.test.js.map +1 -1
- package/dist.esm/index.d.ts +4 -4
- package/dist.esm/index.js +4 -4
- package/dist.esm/inspect.d.ts +28 -28
- package/dist.esm/inspect.js +339 -339
- package/dist.esm/inspect.js.map +1 -1
- package/dist.esm/inspect.test.d.ts +1 -1
- package/dist.esm/logger.d.ts +145 -145
- package/dist.esm/logger.js +323 -323
- package/dist.esm/logger.js.map +1 -1
- package/dist.esm/logger.test.d.ts +1 -1
- package/dist.esm/logger.test.js.map +1 -1
- package/dist.esm/logging.module.d.ts +17 -17
- package/dist.esm/logging.module.js +25 -25
- package/dist.esm/logging.module.js.map +1 -1
- package/dist.esm/test.d.ts +1 -1
- package/dist.esm/trace.d.ts +60 -60
- package/dist.esm/trace.js +208 -208
- package/dist.esm/trace.js.map +1 -1
- package/dist.esm/trace.test.d.ts +1 -1
- package/dist.esm/trace.test.js.map +1 -1
- package/package.json +10 -10
- package/tsconfig.esm.tsbuildinfo +1 -0
- package/tsconfig.json +0 -2
- package/tsconfig.tsbuildinfo +1 -5735
package/dist/trace.js
CHANGED
|
@@ -1,216 +1,215 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* (C) 2017-2019 William Lahti
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
* to the
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* -
|
|
29
|
-
*
|
|
30
|
-
* message upon
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
} // [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
// - When used
|
|
77
|
-
// -
|
|
78
|
-
|
|
79
|
-
let
|
|
80
|
-
let
|
|
81
|
-
let
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
site.propertyDescriptor.value
|
|
88
|
-
|
|
89
|
-
let
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
let
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
let
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
let
|
|
127
|
-
|
|
128
|
-
let
|
|
129
|
-
let
|
|
130
|
-
let
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
(
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* If an exception occurs within the target method, report that exception to the console and rethrow.
|
|
179
|
-
*/
|
|
180
|
-
function ReportExceptionsToConsole() {
|
|
181
|
-
return annotations_1.Mutator.define({
|
|
182
|
-
options: {
|
|
183
|
-
validTargets: ['method']
|
|
184
|
-
},
|
|
185
|
-
invoke(site) {
|
|
186
|
-
let originalMethod = site.propertyDescriptor.value;
|
|
187
|
-
site.propertyDescriptor.value = function (...args) {
|
|
188
|
-
let type;
|
|
189
|
-
let isStatic = false;
|
|
190
|
-
if (typeof site.target === 'function') {
|
|
191
|
-
type = site.target;
|
|
192
|
-
isStatic = true;
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
type = site.target.constructor;
|
|
196
|
-
isStatic = false;
|
|
197
|
-
}
|
|
198
|
-
let typeName;
|
|
199
|
-
let sep = '.';
|
|
200
|
-
if (isStatic)
|
|
201
|
-
sep = '#';
|
|
202
|
-
typeName = type.name;
|
|
203
|
-
try {
|
|
204
|
-
return originalMethod.apply(this, args);
|
|
205
|
-
}
|
|
206
|
-
catch (e) {
|
|
207
|
-
console.error(`Error occurred during ${typeName}${sep}${site.propertyKey}():`);
|
|
208
|
-
console.error(e);
|
|
209
|
-
throw e;
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
exports.ReportExceptionsToConsole = ReportExceptionsToConsole;
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* (C) 2017-2019 William Lahti
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getTracingEnabled = getTracingEnabled;
|
|
7
|
+
exports.setTracingEnabled = setTracingEnabled;
|
|
8
|
+
exports.Trace = Trace;
|
|
9
|
+
exports.ReportExceptionsToConsole = ReportExceptionsToConsole;
|
|
10
|
+
const annotations_1 = require("@alterior/annotations");
|
|
11
|
+
const common_1 = require("@alterior/common");
|
|
12
|
+
const logger_1 = require("./logger");
|
|
13
|
+
let ENABLED = false;
|
|
14
|
+
function getTracingEnabled() {
|
|
15
|
+
return ENABLED;
|
|
16
|
+
}
|
|
17
|
+
function setTracingEnabled(enabled) {
|
|
18
|
+
ENABLED = enabled;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Prints messages related to the execution of the decorated method
|
|
22
|
+
* to the console.
|
|
23
|
+
*
|
|
24
|
+
* - When multiple traced functions are involved, the output is indented
|
|
25
|
+
* appropriately.
|
|
26
|
+
* - Intercepts console messages from within the function to add
|
|
27
|
+
* appropriate indentation.
|
|
28
|
+
* - Records (and rethrows) exceptions thrown from within the function.
|
|
29
|
+
* - For methods returning promises, the promise itself is traced,
|
|
30
|
+
* printing a "Resolved" message upon completion or a "Rejected"
|
|
31
|
+
* message upon rejection.
|
|
32
|
+
*
|
|
33
|
+
* Note that this functionality can be enabled and disabled by configuring
|
|
34
|
+
* the `tracing` option when configuring this module for your application.
|
|
35
|
+
* When @Trace() is used outside of an Alterior execution context, the trace
|
|
36
|
+
* logs are always enabled, and the default log listeners are used.
|
|
37
|
+
*
|
|
38
|
+
* For example, given a class:
|
|
39
|
+
*
|
|
40
|
+
```
|
|
41
|
+
class Thing {
|
|
42
|
+
@ConsoleTrace()
|
|
43
|
+
static doSomething(data : any, stuff : number) {
|
|
44
|
+
console.log("ALMOST...");
|
|
45
|
+
try {
|
|
46
|
+
this.anotherSomething(stuff);
|
|
47
|
+
} catch (e) {
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
@ConsoleTrace()
|
|
52
|
+
static anotherSomething(stuff : number) {
|
|
53
|
+
console.log("NAH...");
|
|
54
|
+
throw new Error('Uh oh');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
* When executed, one may see:
|
|
59
|
+
```sh
|
|
60
|
+
Thing#doSomething({"stuff":321,"other":"nice"}, 12333) {
|
|
61
|
+
ALMOST...
|
|
62
|
+
Thing#anotherSomething(12333) {
|
|
63
|
+
NAH...
|
|
64
|
+
(!!) Exception:
|
|
65
|
+
Error: Uh oh
|
|
66
|
+
} // [Exception] Thing#anotherSomething(12333)
|
|
67
|
+
} // [Done, 6ms] Thing#doSomething({"stuff":321,"other":"nice"}, 12333)
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
function Trace() {
|
|
71
|
+
return annotations_1.Mutator.define({
|
|
72
|
+
options: {
|
|
73
|
+
validTargets: ['method']
|
|
74
|
+
},
|
|
75
|
+
invoke(site) {
|
|
76
|
+
// - When used outside of Alterior, we will *always trace*.
|
|
77
|
+
// - When used inside an Alterior app, we will not trace by default.
|
|
78
|
+
// - If optionsRef.options.tracing is set to true, we trace.
|
|
79
|
+
let optionsRef = logger_1.LoggingOptionsRef.currentRef;
|
|
80
|
+
let options = optionsRef ? (optionsRef.options || {}) : null;
|
|
81
|
+
let enabled = options ? (0, common_1.coalesce)(options.tracing, false) : true;
|
|
82
|
+
let logger = logger_1.Logger.current;
|
|
83
|
+
if (!enabled)
|
|
84
|
+
return;
|
|
85
|
+
if (!ENABLED)
|
|
86
|
+
return;
|
|
87
|
+
let originalMethod = site.propertyDescriptor.value;
|
|
88
|
+
site.propertyDescriptor.value = function (...args) {
|
|
89
|
+
let type;
|
|
90
|
+
let isStatic = false;
|
|
91
|
+
if (typeof site.target === 'function') {
|
|
92
|
+
type = site.target;
|
|
93
|
+
isStatic = true;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
type = site.target.constructor;
|
|
97
|
+
isStatic = false;
|
|
98
|
+
}
|
|
99
|
+
let typeName;
|
|
100
|
+
let sep = '.';
|
|
101
|
+
if (isStatic)
|
|
102
|
+
sep = '#';
|
|
103
|
+
typeName = type.name;
|
|
104
|
+
let startedAt = Date.now();
|
|
105
|
+
let argStrings = [];
|
|
106
|
+
for (let arg of args) {
|
|
107
|
+
if (arg === null)
|
|
108
|
+
argStrings.push('null');
|
|
109
|
+
else if (arg === undefined)
|
|
110
|
+
argStrings.push('undefined');
|
|
111
|
+
else if (arg === true)
|
|
112
|
+
argStrings.push('true');
|
|
113
|
+
else if (arg === false)
|
|
114
|
+
argStrings.push('false');
|
|
115
|
+
else if (typeof arg === 'string')
|
|
116
|
+
argStrings.push(JSON.stringify(arg));
|
|
117
|
+
else if (typeof arg === 'function')
|
|
118
|
+
argStrings.push(arg.name);
|
|
119
|
+
else if (typeof arg === 'object')
|
|
120
|
+
argStrings.push(JSON.stringify(arg));
|
|
121
|
+
else
|
|
122
|
+
argStrings.push('' + arg);
|
|
123
|
+
}
|
|
124
|
+
let methodSpec = `${common_1.ConsoleColors.cyan(`${typeName}${sep}${site.propertyKey}`)}(${argStrings.join(', ')})`;
|
|
125
|
+
logger.debug(`${methodSpec} {`);
|
|
126
|
+
let value;
|
|
127
|
+
let finish = (message) => {
|
|
128
|
+
let time = Date.now() - startedAt;
|
|
129
|
+
let components = [message || common_1.ConsoleColors.green(`Done`)];
|
|
130
|
+
let timingColor = m => m;
|
|
131
|
+
let showTiming = time > 3;
|
|
132
|
+
if (time > 20) {
|
|
133
|
+
timingColor = common_1.ConsoleColors.red;
|
|
134
|
+
}
|
|
135
|
+
else if (time > 5) {
|
|
136
|
+
timingColor = common_1.ConsoleColors.yellow;
|
|
137
|
+
}
|
|
138
|
+
if (showTiming) {
|
|
139
|
+
components.push(timingColor(`${time}ms`));
|
|
140
|
+
}
|
|
141
|
+
logger.debug(`} // [${components.join(', ')}] ${methodSpec}`);
|
|
142
|
+
};
|
|
143
|
+
let status = undefined;
|
|
144
|
+
try {
|
|
145
|
+
(0, common_1.indentConsole)(4, () => {
|
|
146
|
+
try {
|
|
147
|
+
value = originalMethod.apply(this, args);
|
|
148
|
+
}
|
|
149
|
+
catch (e) {
|
|
150
|
+
console.error(`${common_1.ConsoleColors.red(`(!!)`)} Exception:`);
|
|
151
|
+
(0, common_1.indentConsole)(6, () => console.error(e));
|
|
152
|
+
throw e;
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
catch (e) {
|
|
157
|
+
finish(common_1.ConsoleColors.red(`Exception`));
|
|
158
|
+
throw e;
|
|
159
|
+
}
|
|
160
|
+
if (value && value.then) {
|
|
161
|
+
let promise = value;
|
|
162
|
+
value = promise.then(() => {
|
|
163
|
+
finish(common_1.ConsoleColors.green(`Resolved`));
|
|
164
|
+
}).catch(e => {
|
|
165
|
+
finish(common_1.ConsoleColors.red(`Rejected (${e})`));
|
|
166
|
+
throw e;
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
finish();
|
|
171
|
+
}
|
|
172
|
+
return value;
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* If an exception occurs within the target method, report that exception to the console and rethrow.
|
|
179
|
+
*/
|
|
180
|
+
function ReportExceptionsToConsole() {
|
|
181
|
+
return annotations_1.Mutator.define({
|
|
182
|
+
options: {
|
|
183
|
+
validTargets: ['method']
|
|
184
|
+
},
|
|
185
|
+
invoke(site) {
|
|
186
|
+
let originalMethod = site.propertyDescriptor.value;
|
|
187
|
+
site.propertyDescriptor.value = function (...args) {
|
|
188
|
+
let type;
|
|
189
|
+
let isStatic = false;
|
|
190
|
+
if (typeof site.target === 'function') {
|
|
191
|
+
type = site.target;
|
|
192
|
+
isStatic = true;
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
type = site.target.constructor;
|
|
196
|
+
isStatic = false;
|
|
197
|
+
}
|
|
198
|
+
let typeName;
|
|
199
|
+
let sep = '.';
|
|
200
|
+
if (isStatic)
|
|
201
|
+
sep = '#';
|
|
202
|
+
typeName = type.name;
|
|
203
|
+
try {
|
|
204
|
+
return originalMethod.apply(this, args);
|
|
205
|
+
}
|
|
206
|
+
catch (e) {
|
|
207
|
+
console.error(`Error occurred during ${typeName}${sep}${site.propertyKey}():`);
|
|
208
|
+
console.error(e);
|
|
209
|
+
throw e;
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
}
|
|
216
215
|
//# sourceMappingURL=trace.js.map
|
package/dist/trace.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../src/trace.ts"],"names":[],"mappings":";AAAA;;GAEG
|
|
1
|
+
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../src/trace.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAQH,8CAEC;AAED,8CAEC;AAoDD,sBA4HC;AAKD,8DAsCC;AAvOD,uDAAgD;AAChD,6CAA0E;AAC1E,qCAAwE;AAExE,IAAI,OAAO,GAAa,KAAK,CAAC;AAE9B,SAAgB,iBAAiB;IAC7B,OAAO,OAAO,CAAC;AACnB,CAAC;AAED,SAAgB,iBAAiB,CAAC,OAAiB;IAC/C,OAAO,GAAG,OAAO,CAAC;AACtB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,SAAgB,KAAK;IACjB,OAAO,qBAAO,CAAC,MAAM,CAAC;QAClB,OAAO,EAAE;YACL,YAAY,EAAE,CAAC,QAAQ,CAAC;SAC3B;QAED,MAAM,CAAC,IAAI;YAEP,2DAA2D;YAC3D,oEAAoE;YACpE,4DAA4D;YAE5D,IAAI,UAAU,GAAG,0BAAiB,CAAC,UAAU,CAAC;YAC9C,IAAI,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YAC7D,IAAI,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,IAAA,iBAAQ,EAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YAChE,IAAI,MAAM,GAAG,eAAM,CAAC,OAAO,CAAC;YAE5B,IAAI,CAAC,OAAO;gBACR,OAAO;YAEX,IAAI,CAAC,OAAO;gBACR,OAAO;YAEX,IAAI,cAAc,GAAc,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC;YAC9D,IAAI,CAAC,kBAAkB,CAAC,KAAK,GAAG,UAAU,GAA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@
|
|
|
1
|
-
{"version":3,"file":"trace.test.js","sourceRoot":"","sources":["../src/trace.test.ts"],"names":[],"mappings":";;;AAAA,mCAA+B;AAC/B,mCAAsE;AACtE,6CAAoD;AACpD,+BAA8B;AAG9B,IAAA,cAAK,EAAC,QAAQ,CAAC,EAAE;IACb,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE;QACnB,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;YACnC,IAAI,iBAAiB,GAAG,IAAA,yBAAiB,GAAE,CAAC;YAC5C,IAAA,yBAAiB,EAAC,IAAI,CAAC,CAAC;YAExB,IAAI;
|
|
1
|
+
{"version":3,"file":"trace.test.js","sourceRoot":"","sources":["../src/trace.test.ts"],"names":[],"mappings":";;;AAAA,mCAA+B;AAC/B,mCAAsE;AACtE,6CAAoD;AACpD,+BAA8B;AAG9B,IAAA,cAAK,EAAC,QAAQ,CAAC,EAAE;IACb,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE;QACnB,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;YACnC,IAAI,iBAAiB,GAAG,IAAA,yBAAiB,GAAE,CAAC;YAC5C,IAAA,yBAAiB,EAAC,IAAI,CAAC,CAAC;YAExB,IAAI,CAAC;gBACD,IAAI,GAAG,GAAG,EAAE,CAAC;gBAEb,IAAA,yBAAgB,EAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;oBACjD,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;gBAClD,CAAC,EAAE,GAAG,EAAE;oBACJ,MAAM,KAAK;wBAEA,AAAP,MAAM,CAAC,WAAW,CAAC,IAAU,EAAE,KAAc;4BACzC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;4BAClC,IAAI,CAAC;gCACD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;4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AAC,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;gBAC1D,IAAA,aAAM,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;gBAEvC,IAAA,aAAM,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC;gBAC5D,IAAA,aAAM,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;gBAC/C,IAAA,aAAM,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;gBAClD,IAAA,aAAM,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;gBACvC,IAAA,aAAM,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAC3C,CAAC;oBAAS,CAAC;gBACP,IAAA,yBAAiB,EAAC,iBAAiB,CAAC,CAAC;YACzC,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
package/dist.esm/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './inspect';
|
|
2
|
-
export * from './logger';
|
|
3
|
-
export * from './trace';
|
|
4
|
-
export * from './logging.module';
|
|
1
|
+
export * from './inspect';
|
|
2
|
+
export * from './logger';
|
|
3
|
+
export * from './trace';
|
|
4
|
+
export * from './logging.module';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist.esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './inspect';
|
|
2
|
-
export * from './logger';
|
|
3
|
-
export * from './trace';
|
|
4
|
-
export * from './logging.module';
|
|
1
|
+
export * from './inspect';
|
|
2
|
+
export * from './logger';
|
|
3
|
+
export * from './trace';
|
|
4
|
+
export * from './logging.module';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/dist.esm/inspect.d.ts
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Module exports.
|
|
3
|
-
*/
|
|
4
|
-
export interface InspectOptions {
|
|
5
|
-
stylize: (str: any, styleType: any) => any;
|
|
6
|
-
depth?: number;
|
|
7
|
-
colors?: boolean;
|
|
8
|
-
showHidden?: boolean;
|
|
9
|
-
customInspect?: boolean;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Echos the value of a value. Trys to print the value out
|
|
13
|
-
* in the best way possible given the different types.
|
|
14
|
-
*
|
|
15
|
-
* @param {Object} obj The object to print out.
|
|
16
|
-
* @param {Object} opts Optional options object that alters the output.
|
|
17
|
-
* @license MIT (© Joyent)
|
|
18
|
-
*/
|
|
19
|
-
export declare function inspect(obj: any, opts?: InspectOptions): string;
|
|
20
|
-
/**
|
|
21
|
-
* Pass the string through with no stylization.
|
|
22
|
-
*/
|
|
23
|
-
export declare function stylizeNothing(str: any, styleType: any): any;
|
|
24
|
-
/**
|
|
25
|
-
* Use console colors to style the string. Suitable for output to
|
|
26
|
-
* terminals with ANSI color support.
|
|
27
|
-
*/
|
|
28
|
-
export declare function stylizeWithConsoleColors(str: any, styleType: any): any;
|
|
1
|
+
/**
|
|
2
|
+
* Module exports.
|
|
3
|
+
*/
|
|
4
|
+
export interface InspectOptions {
|
|
5
|
+
stylize: (str: any, styleType: any) => any;
|
|
6
|
+
depth?: number;
|
|
7
|
+
colors?: boolean;
|
|
8
|
+
showHidden?: boolean;
|
|
9
|
+
customInspect?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Echos the value of a value. Trys to print the value out
|
|
13
|
+
* in the best way possible given the different types.
|
|
14
|
+
*
|
|
15
|
+
* @param {Object} obj The object to print out.
|
|
16
|
+
* @param {Object} opts Optional options object that alters the output.
|
|
17
|
+
* @license MIT (© Joyent)
|
|
18
|
+
*/
|
|
19
|
+
export declare function inspect(obj: any, opts?: InspectOptions): string;
|
|
20
|
+
/**
|
|
21
|
+
* Pass the string through with no stylization.
|
|
22
|
+
*/
|
|
23
|
+
export declare function stylizeNothing(str: any, styleType: any): any;
|
|
24
|
+
/**
|
|
25
|
+
* Use console colors to style the string. Suitable for output to
|
|
26
|
+
* terminals with ANSI color support.
|
|
27
|
+
*/
|
|
28
|
+
export declare function stylizeWithConsoleColors(str: any, styleType: any): any;
|
|
29
29
|
//# sourceMappingURL=inspect.d.ts.map
|