@nweb/core
Advanced tools
+2
-0
@@ -56,2 +56,4 @@ import Configuration from './conf'; | ||
| shutdown(): Promise<void>; | ||
| static setRuntimeVariable<R>(variable: Record<string, any>, runnable: () => R): void; | ||
| static getRuntimeVariable(key?: string): any; | ||
| } | ||
@@ -58,0 +60,0 @@ export type Active = 'dev' | 'development' | 'prod' | 'production' | 'test' | 'testing'; |
+9
-0
@@ -46,2 +46,4 @@ "use strict"; | ||
| const fs_1 = __importDefault(require("fs")); | ||
| const async_hooks_1 = require("async_hooks"); | ||
| const asyncLocalStorage = new async_hooks_1.AsyncLocalStorage(); | ||
| const path = require('path'); | ||
@@ -668,2 +670,9 @@ const loadModule = function (metadata, config) { | ||
| } | ||
| static setRuntimeVariable(variable, runnable) { | ||
| asyncLocalStorage.run(variable, () => runnable()); | ||
| } | ||
| static getRuntimeVariable(key) { | ||
| let store = asyncLocalStorage.getStore(); | ||
| return key ? store?.[key] : store; | ||
| } | ||
| } | ||
@@ -670,0 +679,0 @@ exports.default = VWebApplicationContext; |
+1
-1
| { | ||
| "name": "@nweb/core", | ||
| "version": "1.1.7", | ||
| "version": "1.1.8", | ||
| "description": "web核心组件", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index", |
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
140656
0.36%4111
0.27%25
4.17%