Comparing version 0.5.0 to 0.5.1
12
index.js
@@ -67,2 +67,8 @@ "use strict"; | ||
} | ||
class CnysaMarkResource extends ah.AsyncResource { | ||
constructor(tag) { | ||
super(`(${tag})`); | ||
this.emitDestroy(); | ||
} | ||
} | ||
/** | ||
@@ -81,3 +87,3 @@ * A class that collects AsyncResource lifecycle events for visualization | ||
this.resources = { | ||
1: { uid: 1, type: '(initial)', parents: [], stack: [], internal: false, custom: false } | ||
1: { uid: 1, type: '(initial)', parents: [], stack: [], internal: true, custom: false } | ||
}; | ||
@@ -98,3 +104,3 @@ this.currentScopes = [{ id: 1, stack: [] }]; | ||
const stack = stack_trace_1.createStackTrace().slice(4); | ||
const internal = type.startsWith('cnysa'); | ||
const internal = resource instanceof CnysaMarkResource; | ||
const custom = resource instanceof ah.AsyncResource; | ||
@@ -218,3 +224,3 @@ this.resources[uid] = { uid, type, parents: this.currentScopes.map(x => x.id), stack, internal, custom }; | ||
} | ||
new ah.AsyncResource(`cnysa(${tag})`).emitDestroy(); | ||
new CnysaMarkResource(tag); | ||
return this; | ||
@@ -221,0 +227,0 @@ } |
{ | ||
"name": "cnysa", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "A tool for understanding async-hooks", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33084
666