@gjsify/diagnostics_channel 0.3.12 → 0.3.14
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/lib/esm/index.js +264 -252
- package/package.json +3 -3
package/lib/esm/index.js
CHANGED
|
@@ -1,263 +1,275 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
1
|
+
//#region src/index.ts
|
|
2
|
+
const channels = new Map();
|
|
3
|
+
/**
|
|
4
|
+
* A named channel for publishing diagnostic messages.
|
|
5
|
+
*/
|
|
6
|
+
var Channel = class {
|
|
7
|
+
name;
|
|
8
|
+
_subscribers = [];
|
|
9
|
+
constructor(name) {
|
|
10
|
+
this.name = name;
|
|
11
|
+
}
|
|
12
|
+
/** Whether this channel has active subscribers. */
|
|
13
|
+
get hasSubscribers() {
|
|
14
|
+
return this._subscribers.length > 0;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Publish a message to all subscribers.
|
|
18
|
+
* Subscriber errors are caught and re-thrown asynchronously so that
|
|
19
|
+
* remaining subscribers still run (matches Node.js behavior).
|
|
20
|
+
*/
|
|
21
|
+
publish(message) {
|
|
22
|
+
if (this._subscribers.length === 0) return;
|
|
23
|
+
const subscribers = this._subscribers;
|
|
24
|
+
for (let i = 0; i < subscribers.length; i++) {
|
|
25
|
+
try {
|
|
26
|
+
subscribers[i](message, this.name);
|
|
27
|
+
} catch (err) {
|
|
28
|
+
Promise.resolve().then(() => {
|
|
29
|
+
throw err;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/** Subscribe to this channel. */
|
|
35
|
+
subscribe(onMessage) {
|
|
36
|
+
if (typeof onMessage !== "function") {
|
|
37
|
+
throw new TypeError("The \"subscription\" argument must be of type function");
|
|
38
|
+
}
|
|
39
|
+
this._subscribers = [...this._subscribers, onMessage];
|
|
40
|
+
}
|
|
41
|
+
/** Unsubscribe from this channel. Returns true if the subscriber was found. */
|
|
42
|
+
unsubscribe(onMessage) {
|
|
43
|
+
const index = this._subscribers.indexOf(onMessage);
|
|
44
|
+
if (index === -1) return false;
|
|
45
|
+
this._subscribers = [...this._subscribers.slice(0, index), ...this._subscribers.slice(index + 1)];
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Run stores and publish (simplified — no AsyncLocalStorage store support yet).
|
|
50
|
+
* Publishes the data and calls fn with the given thisArg and args.
|
|
51
|
+
*/
|
|
52
|
+
runStores(data, fn, thisArg, ...args) {
|
|
53
|
+
this.publish(data);
|
|
54
|
+
return fn.apply(thisArg, args);
|
|
55
|
+
}
|
|
56
|
+
/** Bind a store to this channel (stub — AsyncLocalStorage integration). */
|
|
57
|
+
bindStore(_store, _transform) {}
|
|
58
|
+
/** Unbind a store from this channel (stub). */
|
|
59
|
+
unbindStore(_store) {}
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Get or create a named channel.
|
|
63
|
+
*/
|
|
62
64
|
function channel(name) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
if (typeof name !== "string" && typeof name !== "symbol") {
|
|
66
|
+
throw new TypeError("The \"channel\" argument must be of type string or symbol");
|
|
67
|
+
}
|
|
68
|
+
let ch = channels.get(name);
|
|
69
|
+
if (!ch) {
|
|
70
|
+
ch = new Channel(name);
|
|
71
|
+
channels.set(name, ch);
|
|
72
|
+
}
|
|
73
|
+
return ch;
|
|
72
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Check if the named channel has subscribers.
|
|
77
|
+
*/
|
|
73
78
|
function hasSubscribers(name) {
|
|
74
|
-
|
|
75
|
-
|
|
79
|
+
const ch = channels.get(name);
|
|
80
|
+
return ch ? ch.hasSubscribers : false;
|
|
76
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Subscribe to a named channel.
|
|
84
|
+
*/
|
|
77
85
|
function subscribe(name, onMessage) {
|
|
78
|
-
|
|
86
|
+
channel(name).subscribe(onMessage);
|
|
79
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Unsubscribe from a named channel.
|
|
90
|
+
*/
|
|
80
91
|
function unsubscribe(name, onMessage) {
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
class TracingChannel {
|
|
84
|
-
start;
|
|
85
|
-
end;
|
|
86
|
-
asyncStart;
|
|
87
|
-
asyncEnd;
|
|
88
|
-
error;
|
|
89
|
-
constructor(nameOrChannels) {
|
|
90
|
-
if (typeof nameOrChannels === "string") {
|
|
91
|
-
const name = nameOrChannels;
|
|
92
|
-
this.start = channel(`tracing:${name}:start`);
|
|
93
|
-
this.end = channel(`tracing:${name}:end`);
|
|
94
|
-
this.asyncStart = channel(`tracing:${name}:asyncStart`);
|
|
95
|
-
this.asyncEnd = channel(`tracing:${name}:asyncEnd`);
|
|
96
|
-
this.error = channel(`tracing:${name}:error`);
|
|
97
|
-
} else if (typeof nameOrChannels === "object" && nameOrChannels !== null) {
|
|
98
|
-
const traceEvents = ["start", "end", "asyncStart", "asyncEnd", "error"];
|
|
99
|
-
for (const eventName of traceEvents) {
|
|
100
|
-
const ch = nameOrChannels[eventName];
|
|
101
|
-
if (!(ch instanceof Channel)) {
|
|
102
|
-
throw new TypeError(
|
|
103
|
-
`The "nameOrChannels.${eventName}" property must be an instance of Channel`
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
this.start = nameOrChannels.start;
|
|
108
|
-
this.end = nameOrChannels.end;
|
|
109
|
-
this.asyncStart = nameOrChannels.asyncStart;
|
|
110
|
-
this.asyncEnd = nameOrChannels.asyncEnd;
|
|
111
|
-
this.error = nameOrChannels.error;
|
|
112
|
-
} else {
|
|
113
|
-
throw new TypeError(
|
|
114
|
-
'The "nameOrChannels" argument must be of type string or an instance of TracingChannel or Object'
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
/** Whether any of the tracing sub-channels has subscribers. */
|
|
119
|
-
get hasSubscribers() {
|
|
120
|
-
return this.start.hasSubscribers || this.end.hasSubscribers || this.asyncStart.hasSubscribers || this.asyncEnd.hasSubscribers || this.error.hasSubscribers;
|
|
121
|
-
}
|
|
122
|
-
/** Subscribe to all tracing channels. */
|
|
123
|
-
subscribe(handlers) {
|
|
124
|
-
if (handlers.start) this.start.subscribe(handlers.start);
|
|
125
|
-
if (handlers.end) this.end.subscribe(handlers.end);
|
|
126
|
-
if (handlers.asyncStart) this.asyncStart.subscribe(handlers.asyncStart);
|
|
127
|
-
if (handlers.asyncEnd) this.asyncEnd.subscribe(handlers.asyncEnd);
|
|
128
|
-
if (handlers.error) this.error.subscribe(handlers.error);
|
|
129
|
-
}
|
|
130
|
-
/** Unsubscribe from all tracing channels. Returns true if all were found. */
|
|
131
|
-
unsubscribe(handlers) {
|
|
132
|
-
let done = true;
|
|
133
|
-
if (handlers.start && !this.start.unsubscribe(handlers.start)) done = false;
|
|
134
|
-
if (handlers.end && !this.end.unsubscribe(handlers.end)) done = false;
|
|
135
|
-
if (handlers.asyncStart && !this.asyncStart.unsubscribe(handlers.asyncStart)) done = false;
|
|
136
|
-
if (handlers.asyncEnd && !this.asyncEnd.unsubscribe(handlers.asyncEnd)) done = false;
|
|
137
|
-
if (handlers.error && !this.error.unsubscribe(handlers.error)) done = false;
|
|
138
|
-
return done;
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Execute a function within a tracing context.
|
|
142
|
-
* Matches Node.js signature: traceSync(fn, context, thisArg, ...args)
|
|
143
|
-
*/
|
|
144
|
-
traceSync(fn, context = {}, thisArg, ...args) {
|
|
145
|
-
if (!this.hasSubscribers) {
|
|
146
|
-
return fn.apply(thisArg, args);
|
|
147
|
-
}
|
|
148
|
-
const { start, end, error } = this;
|
|
149
|
-
start.publish(context);
|
|
150
|
-
try {
|
|
151
|
-
const result = fn.apply(thisArg, args);
|
|
152
|
-
context.result = result;
|
|
153
|
-
return result;
|
|
154
|
-
} catch (err) {
|
|
155
|
-
context.error = err;
|
|
156
|
-
error.publish(context);
|
|
157
|
-
throw err;
|
|
158
|
-
} finally {
|
|
159
|
-
end.publish(context);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Execute an async function within a tracing context.
|
|
164
|
-
* Matches Node.js signature: tracePromise(fn, context, thisArg, ...args)
|
|
165
|
-
*/
|
|
166
|
-
tracePromise(fn, context = {}, thisArg, ...args) {
|
|
167
|
-
if (!this.hasSubscribers) {
|
|
168
|
-
return fn.apply(thisArg, args);
|
|
169
|
-
}
|
|
170
|
-
const { start, end, asyncStart, asyncEnd, error } = this;
|
|
171
|
-
function resolve(result) {
|
|
172
|
-
context.result = result;
|
|
173
|
-
asyncStart.publish(context);
|
|
174
|
-
asyncEnd.publish(context);
|
|
175
|
-
return result;
|
|
176
|
-
}
|
|
177
|
-
function reject(err) {
|
|
178
|
-
context.error = err;
|
|
179
|
-
error.publish(context);
|
|
180
|
-
asyncStart.publish(context);
|
|
181
|
-
asyncEnd.publish(context);
|
|
182
|
-
throw err;
|
|
183
|
-
}
|
|
184
|
-
start.publish(context);
|
|
185
|
-
try {
|
|
186
|
-
const result = fn.apply(thisArg, args);
|
|
187
|
-
if (typeof result?.then !== "function") {
|
|
188
|
-
context.result = result;
|
|
189
|
-
return result;
|
|
190
|
-
}
|
|
191
|
-
return result.then(resolve, reject);
|
|
192
|
-
} catch (err) {
|
|
193
|
-
context.error = err;
|
|
194
|
-
error.publish(context);
|
|
195
|
-
throw err;
|
|
196
|
-
} finally {
|
|
197
|
-
end.publish(context);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Execute a callback-style function within a tracing context.
|
|
202
|
-
* Matches Node.js signature: traceCallback(fn, position, context, thisArg, ...args)
|
|
203
|
-
*/
|
|
204
|
-
traceCallback(fn, position = -1, context = {}, thisArg, ...args) {
|
|
205
|
-
if (!this.hasSubscribers) {
|
|
206
|
-
return fn.apply(thisArg, args);
|
|
207
|
-
}
|
|
208
|
-
const { start, end, asyncStart, asyncEnd, error } = this;
|
|
209
|
-
const actualPos = position < 0 ? args.length + position : position;
|
|
210
|
-
const callback = args[actualPos];
|
|
211
|
-
if (typeof callback !== "function") {
|
|
212
|
-
throw new TypeError('The "callback" argument must be of type function');
|
|
213
|
-
}
|
|
214
|
-
function wrappedCallback(err, res) {
|
|
215
|
-
if (err) {
|
|
216
|
-
context.error = err;
|
|
217
|
-
error.publish(context);
|
|
218
|
-
} else {
|
|
219
|
-
context.result = res;
|
|
220
|
-
}
|
|
221
|
-
asyncStart.publish(context);
|
|
222
|
-
try {
|
|
223
|
-
return callback.apply(this, arguments);
|
|
224
|
-
} finally {
|
|
225
|
-
asyncEnd.publish(context);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
const wrappedArgs = [...args];
|
|
229
|
-
wrappedArgs[actualPos] = wrappedCallback;
|
|
230
|
-
start.publish(context);
|
|
231
|
-
try {
|
|
232
|
-
return fn.apply(thisArg, wrappedArgs);
|
|
233
|
-
} catch (err) {
|
|
234
|
-
context.error = err;
|
|
235
|
-
error.publish(context);
|
|
236
|
-
throw err;
|
|
237
|
-
} finally {
|
|
238
|
-
end.publish(context);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
92
|
+
return channel(name).unsubscribe(onMessage);
|
|
241
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* TracingChannel — groups related channels for start/end/asyncStart/asyncEnd/error.
|
|
96
|
+
*/
|
|
97
|
+
var TracingChannel = class {
|
|
98
|
+
start;
|
|
99
|
+
end;
|
|
100
|
+
asyncStart;
|
|
101
|
+
asyncEnd;
|
|
102
|
+
error;
|
|
103
|
+
constructor(nameOrChannels) {
|
|
104
|
+
if (typeof nameOrChannels === "string") {
|
|
105
|
+
const name = nameOrChannels;
|
|
106
|
+
this.start = channel(`tracing:${name}:start`);
|
|
107
|
+
this.end = channel(`tracing:${name}:end`);
|
|
108
|
+
this.asyncStart = channel(`tracing:${name}:asyncStart`);
|
|
109
|
+
this.asyncEnd = channel(`tracing:${name}:asyncEnd`);
|
|
110
|
+
this.error = channel(`tracing:${name}:error`);
|
|
111
|
+
} else if (typeof nameOrChannels === "object" && nameOrChannels !== null) {
|
|
112
|
+
const traceEvents = [
|
|
113
|
+
"start",
|
|
114
|
+
"end",
|
|
115
|
+
"asyncStart",
|
|
116
|
+
"asyncEnd",
|
|
117
|
+
"error"
|
|
118
|
+
];
|
|
119
|
+
for (const eventName of traceEvents) {
|
|
120
|
+
const ch = nameOrChannels[eventName];
|
|
121
|
+
if (!(ch instanceof Channel)) {
|
|
122
|
+
throw new TypeError(`The "nameOrChannels.${eventName}" property must be an instance of Channel`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
this.start = nameOrChannels.start;
|
|
126
|
+
this.end = nameOrChannels.end;
|
|
127
|
+
this.asyncStart = nameOrChannels.asyncStart;
|
|
128
|
+
this.asyncEnd = nameOrChannels.asyncEnd;
|
|
129
|
+
this.error = nameOrChannels.error;
|
|
130
|
+
} else {
|
|
131
|
+
throw new TypeError("The \"nameOrChannels\" argument must be of type string or an instance of TracingChannel or Object");
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/** Whether any of the tracing sub-channels has subscribers. */
|
|
135
|
+
get hasSubscribers() {
|
|
136
|
+
return this.start.hasSubscribers || this.end.hasSubscribers || this.asyncStart.hasSubscribers || this.asyncEnd.hasSubscribers || this.error.hasSubscribers;
|
|
137
|
+
}
|
|
138
|
+
/** Subscribe to all tracing channels. */
|
|
139
|
+
subscribe(handlers) {
|
|
140
|
+
if (handlers.start) this.start.subscribe(handlers.start);
|
|
141
|
+
if (handlers.end) this.end.subscribe(handlers.end);
|
|
142
|
+
if (handlers.asyncStart) this.asyncStart.subscribe(handlers.asyncStart);
|
|
143
|
+
if (handlers.asyncEnd) this.asyncEnd.subscribe(handlers.asyncEnd);
|
|
144
|
+
if (handlers.error) this.error.subscribe(handlers.error);
|
|
145
|
+
}
|
|
146
|
+
/** Unsubscribe from all tracing channels. Returns true if all were found. */
|
|
147
|
+
unsubscribe(handlers) {
|
|
148
|
+
let done = true;
|
|
149
|
+
if (handlers.start && !this.start.unsubscribe(handlers.start)) done = false;
|
|
150
|
+
if (handlers.end && !this.end.unsubscribe(handlers.end)) done = false;
|
|
151
|
+
if (handlers.asyncStart && !this.asyncStart.unsubscribe(handlers.asyncStart)) done = false;
|
|
152
|
+
if (handlers.asyncEnd && !this.asyncEnd.unsubscribe(handlers.asyncEnd)) done = false;
|
|
153
|
+
if (handlers.error && !this.error.unsubscribe(handlers.error)) done = false;
|
|
154
|
+
return done;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Execute a function within a tracing context.
|
|
158
|
+
* Matches Node.js signature: traceSync(fn, context, thisArg, ...args)
|
|
159
|
+
*/
|
|
160
|
+
traceSync(fn, context = {}, thisArg, ...args) {
|
|
161
|
+
if (!this.hasSubscribers) {
|
|
162
|
+
return fn.apply(thisArg, args);
|
|
163
|
+
}
|
|
164
|
+
const { start, end, error } = this;
|
|
165
|
+
start.publish(context);
|
|
166
|
+
try {
|
|
167
|
+
const result = fn.apply(thisArg, args);
|
|
168
|
+
context.result = result;
|
|
169
|
+
return result;
|
|
170
|
+
} catch (err) {
|
|
171
|
+
context.error = err;
|
|
172
|
+
error.publish(context);
|
|
173
|
+
throw err;
|
|
174
|
+
} finally {
|
|
175
|
+
end.publish(context);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Execute an async function within a tracing context.
|
|
180
|
+
* Matches Node.js signature: tracePromise(fn, context, thisArg, ...args)
|
|
181
|
+
*/
|
|
182
|
+
tracePromise(fn, context = {}, thisArg, ...args) {
|
|
183
|
+
if (!this.hasSubscribers) {
|
|
184
|
+
return fn.apply(thisArg, args);
|
|
185
|
+
}
|
|
186
|
+
const { start, end, asyncStart, asyncEnd, error } = this;
|
|
187
|
+
function resolve(result) {
|
|
188
|
+
context.result = result;
|
|
189
|
+
asyncStart.publish(context);
|
|
190
|
+
asyncEnd.publish(context);
|
|
191
|
+
return result;
|
|
192
|
+
}
|
|
193
|
+
function reject(err) {
|
|
194
|
+
context.error = err;
|
|
195
|
+
error.publish(context);
|
|
196
|
+
asyncStart.publish(context);
|
|
197
|
+
asyncEnd.publish(context);
|
|
198
|
+
throw err;
|
|
199
|
+
}
|
|
200
|
+
start.publish(context);
|
|
201
|
+
try {
|
|
202
|
+
const result = fn.apply(thisArg, args);
|
|
203
|
+
if (typeof result?.then !== "function") {
|
|
204
|
+
context.result = result;
|
|
205
|
+
return result;
|
|
206
|
+
}
|
|
207
|
+
return result.then(resolve, reject);
|
|
208
|
+
} catch (err) {
|
|
209
|
+
context.error = err;
|
|
210
|
+
error.publish(context);
|
|
211
|
+
throw err;
|
|
212
|
+
} finally {
|
|
213
|
+
end.publish(context);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Execute a callback-style function within a tracing context.
|
|
218
|
+
* Matches Node.js signature: traceCallback(fn, position, context, thisArg, ...args)
|
|
219
|
+
*/
|
|
220
|
+
traceCallback(fn, position = -1, context = {}, thisArg, ...args) {
|
|
221
|
+
if (!this.hasSubscribers) {
|
|
222
|
+
return fn.apply(thisArg, args);
|
|
223
|
+
}
|
|
224
|
+
const { start, end, asyncStart, asyncEnd, error } = this;
|
|
225
|
+
const actualPos = position < 0 ? args.length + position : position;
|
|
226
|
+
const callback = args[actualPos];
|
|
227
|
+
if (typeof callback !== "function") {
|
|
228
|
+
throw new TypeError("The \"callback\" argument must be of type function");
|
|
229
|
+
}
|
|
230
|
+
function wrappedCallback(err, res) {
|
|
231
|
+
if (err) {
|
|
232
|
+
context.error = err;
|
|
233
|
+
error.publish(context);
|
|
234
|
+
} else {
|
|
235
|
+
context.result = res;
|
|
236
|
+
}
|
|
237
|
+
asyncStart.publish(context);
|
|
238
|
+
try {
|
|
239
|
+
return callback.apply(this, arguments);
|
|
240
|
+
} finally {
|
|
241
|
+
asyncEnd.publish(context);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
const wrappedArgs = [...args];
|
|
245
|
+
wrappedArgs[actualPos] = wrappedCallback;
|
|
246
|
+
start.publish(context);
|
|
247
|
+
try {
|
|
248
|
+
return fn.apply(thisArg, wrappedArgs);
|
|
249
|
+
} catch (err) {
|
|
250
|
+
context.error = err;
|
|
251
|
+
error.publish(context);
|
|
252
|
+
throw err;
|
|
253
|
+
} finally {
|
|
254
|
+
end.publish(context);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
/**
|
|
259
|
+
* Create a TracingChannel instance.
|
|
260
|
+
*/
|
|
242
261
|
function tracingChannel(nameOrChannels) {
|
|
243
|
-
|
|
262
|
+
return new TracingChannel(nameOrChannels);
|
|
244
263
|
}
|
|
245
|
-
var
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
};
|
|
254
|
-
export {
|
|
255
|
-
Channel,
|
|
256
|
-
TracingChannel,
|
|
257
|
-
channel,
|
|
258
|
-
index_default as default,
|
|
259
|
-
hasSubscribers,
|
|
260
|
-
subscribe,
|
|
261
|
-
tracingChannel,
|
|
262
|
-
unsubscribe
|
|
264
|
+
var src_default = {
|
|
265
|
+
Channel,
|
|
266
|
+
channel,
|
|
267
|
+
hasSubscribers,
|
|
268
|
+
subscribe,
|
|
269
|
+
unsubscribe,
|
|
270
|
+
TracingChannel,
|
|
271
|
+
tracingChannel
|
|
263
272
|
};
|
|
273
|
+
|
|
274
|
+
//#endregion
|
|
275
|
+
export { Channel, TracingChannel, channel, src_default as default, hasSubscribers, subscribe, tracingChannel, unsubscribe };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/diagnostics_channel",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.14",
|
|
4
4
|
"description": "Node.js diagnostics_channel module for Gjs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"diagnostics_channel"
|
|
31
31
|
],
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@gjsify/cli": "^0.3.
|
|
34
|
-
"@gjsify/unit": "^0.3.
|
|
33
|
+
"@gjsify/cli": "^0.3.14",
|
|
34
|
+
"@gjsify/unit": "^0.3.14",
|
|
35
35
|
"@types/node": "^25.6.0",
|
|
36
36
|
"typescript": "^6.0.3"
|
|
37
37
|
}
|