@nsshunt/stsutils 1.19.144 → 1.19.145

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/node.cjs ADDED
@@ -0,0 +1,16 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let node_async_hooks = require("node:async_hooks");
3
+ //#region src/di-node.ts
4
+ var NodeInjectionContextStore = class {
5
+ storage = new node_async_hooks.AsyncLocalStorage();
6
+ run(injector, fn) {
7
+ return this.storage.run(injector, fn);
8
+ }
9
+ get() {
10
+ return this.storage.getStore();
11
+ }
12
+ };
13
+ //#endregion
14
+ exports.NodeInjectionContextStore = NodeInjectionContextStore;
15
+
16
+ //# sourceMappingURL=node.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.cjs","names":["AsyncLocalStorage"],"sources":["../src/di-node.ts"],"sourcesContent":["import { AsyncLocalStorage } from \"node:async_hooks\";\n\nimport { Injector, InjectionContextStore } from \"./di.js\";\n\nexport class NodeInjectionContextStore implements InjectionContextStore {\n private readonly storage = new AsyncLocalStorage<Injector>();\n\n run<T>(injector: Injector, fn: () => T): T {\n return this.storage.run(injector, fn);\n }\n\n get(): Injector | undefined {\n return this.storage.getStore();\n }\n}\n"],"mappings":";;;AAIA,IAAa,4BAAb,MAAwE;CACpE,UAA2B,IAAIA,iBAAAA,kBAA4B;CAE3D,IAAO,UAAoB,IAAgB;EACvC,OAAO,KAAK,QAAQ,IAAI,UAAU,EAAE;CACxC;CAEA,MAA4B;EACxB,OAAO,KAAK,QAAQ,SAAS;CACjC;AACJ"}
package/dist/node.mjs ADDED
@@ -0,0 +1,15 @@
1
+ import { AsyncLocalStorage } from "node:async_hooks";
2
+ //#region src/di-node.ts
3
+ var NodeInjectionContextStore = class {
4
+ storage = new AsyncLocalStorage();
5
+ run(injector, fn) {
6
+ return this.storage.run(injector, fn);
7
+ }
8
+ get() {
9
+ return this.storage.getStore();
10
+ }
11
+ };
12
+ //#endregion
13
+ export { NodeInjectionContextStore };
14
+
15
+ //# sourceMappingURL=node.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.mjs","names":[],"sources":["../src/di-node.ts"],"sourcesContent":["import { AsyncLocalStorage } from \"node:async_hooks\";\n\nimport { Injector, InjectionContextStore } from \"./di.js\";\n\nexport class NodeInjectionContextStore implements InjectionContextStore {\n private readonly storage = new AsyncLocalStorage<Injector>();\n\n run<T>(injector: Injector, fn: () => T): T {\n return this.storage.run(injector, fn);\n }\n\n get(): Injector | undefined {\n return this.storage.getStore();\n }\n}\n"],"mappings":";;AAIA,IAAa,4BAAb,MAAwE;CACpE,UAA2B,IAAI,kBAA4B;CAE3D,IAAO,UAAoB,IAAgB;EACvC,OAAO,KAAK,QAAQ,IAAI,UAAU,EAAE;CACxC;CAEA,MAA4B;EACxB,OAAO,KAAK,QAAQ,SAAS;CACjC;AACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nsshunt/stsutils",
3
- "version": "1.19.144",
3
+ "version": "1.19.145",
4
4
  "description": "STS Utils",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -12,6 +12,12 @@
12
12
  "import": "./dist/index.mjs",
13
13
  "require": "./dist/index.cjs",
14
14
  "default": "./dist/index.mjs"
15
+ },
16
+ "./node": {
17
+ "types": "./types/node.d.ts",
18
+ "import": "./dist/node.mjs",
19
+ "require": "./dist/node.cjs",
20
+ "default": "./dist/node.mjs"
15
21
  }
16
22
  },
17
23
  "publishConfig": {
@@ -0,0 +1,2 @@
1
+ export * from "./di-node.js";
2
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}