@gjsify/async_hooks 0.3.19 → 0.3.21

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 (2) hide show
  1. package/lib/esm/index.js +1 -1
  2. package/package.json +4 -4
package/lib/esm/index.js CHANGED
@@ -1 +1 @@
1
- let e=1;function t(){return e}function n(){return 0}function r(e){return{enable(){return this},disable(){return this}}}var i=class n{_type;_asyncId;_triggerAsyncId;constructor(n,r){this._type=n,this._asyncId=e++,typeof r==`number`?this._triggerAsyncId=r:r&&typeof r.triggerAsyncId==`number`?this._triggerAsyncId=r.triggerAsyncId:this._triggerAsyncId=t()}runInAsyncScope(e,t,...n){return e.apply(t,n)}emitDestroy(){return this}asyncId(){return this._asyncId}triggerAsyncId(){return this._triggerAsyncId}bind(e){return((...t)=>this.runInAsyncScope(e,void 0,...t))}static bind(e,t){return new n(t||e.name||`bound-anonymous-fn`).bind(e)}};const a=new Set;var o=class{_store;constructor(){a.add(this)}getStore(){return this._store}run(e,t,...n){let r=this._store;this._store=e;try{let e=t(...n);return e!=null&&typeof e.then==`function`?e.then(e=>(this._store=r,e),e=>{throw this._store=r,e}):(this._store=r,e)}catch(e){throw this._store=r,e}}exit(e,...t){let n=this._store;this._store=void 0;try{return e(...t)}finally{this._store=n}}enterWith(e){this._store=e}disable(){this._store=void 0}static snapshot(){let e=new Map;for(let t of a)e.set(t,t.getStore());return(t,...n)=>{let r=new Map;for(let[t,n]of e)r.set(t,t.getStore()),t._store=n;try{return t(...n)}finally{for(let[e,t]of r)e._store=t}}}},s={executionAsyncId:t,triggerAsyncId:n,createHook:r,AsyncResource:i,AsyncLocalStorage:o};export{o as AsyncLocalStorage,i as AsyncResource,r as createHook,s as default,t as executionAsyncId,n as triggerAsyncId};
1
+ let e=1;function executionAsyncId(){return e}function triggerAsyncId(){return 0}function createHook(e){return{enable(){return this},disable(){return this}}}var t=class AsyncResource{_type;_asyncId;_triggerAsyncId;constructor(t,n){this._type=t,this._asyncId=e++,typeof n==`number`?this._triggerAsyncId=n:n&&typeof n.triggerAsyncId==`number`?this._triggerAsyncId=n.triggerAsyncId:this._triggerAsyncId=executionAsyncId()}runInAsyncScope(e,t,...n){return e.apply(t,n)}emitDestroy(){return this}asyncId(){return this._asyncId}triggerAsyncId(){return this._triggerAsyncId}bind(e){return((...t)=>this.runInAsyncScope(e,void 0,...t))}static bind(e,t){return new AsyncResource(t||e.name||`bound-anonymous-fn`).bind(e)}};const n=new Set;var AsyncLocalStorage=class{_store;constructor(){n.add(this)}getStore(){return this._store}run(e,t,...n){let r=this._store;this._store=e;try{let e=t(...n);return e!=null&&typeof e.then==`function`?e.then(e=>(this._store=r,e),e=>{throw this._store=r,e}):(this._store=r,e)}catch(e){throw this._store=r,e}}exit(e,...t){let n=this._store;this._store=void 0;try{return e(...t)}finally{this._store=n}}enterWith(e){this._store=e}disable(){this._store=void 0}static snapshot(){let e=new Map;for(let t of n)e.set(t,t.getStore());return(t,...n)=>{let r=new Map;for(let[t,n]of e)r.set(t,t.getStore()),t._store=n;try{return t(...n)}finally{for(let[e,t]of r)e._store=t}}}},r={executionAsyncId,triggerAsyncId,createHook,AsyncResource:t,AsyncLocalStorage};export{AsyncLocalStorage,t as AsyncResource,createHook,r as default,executionAsyncId,triggerAsyncId};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/async_hooks",
3
- "version": "0.3.19",
3
+ "version": "0.3.21",
4
4
  "description": "Node.js async_hooks module for Gjs",
5
5
  "type": "module",
6
6
  "module": "lib/esm/index.js",
@@ -30,11 +30,11 @@
30
30
  "async_hooks"
31
31
  ],
32
32
  "dependencies": {
33
- "@gjsify/events": "^0.3.19"
33
+ "@gjsify/events": "^0.3.21"
34
34
  },
35
35
  "devDependencies": {
36
- "@gjsify/cli": "^0.3.19",
37
- "@gjsify/unit": "^0.3.19",
36
+ "@gjsify/cli": "^0.3.21",
37
+ "@gjsify/unit": "^0.3.21",
38
38
  "@types/node": "^25.6.2",
39
39
  "typescript": "^6.0.3"
40
40
  }