@extollo/util
Advanced tools
| import { Collection } from "../collection/Collection"; | ||
| export declare type GlobalRegistrant = { | ||
| key: string | symbol; | ||
| value: any; | ||
| }; | ||
| export declare class GlobalRegistry extends Collection<GlobalRegistrant> { | ||
| constructor(); | ||
| setGlobal(key: string | symbol, value: any): this; | ||
| getGlobal(key: string | symbol): any; | ||
| } | ||
| export declare const globalRegistry: GlobalRegistry; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.globalRegistry = exports.GlobalRegistry = void 0; | ||
| const Collection_1 = require("../collection/Collection"); | ||
| const data_1 = require("./data"); | ||
| class GlobalRegistry extends Collection_1.Collection { | ||
| constructor() { | ||
| super(); | ||
| this.setGlobal('registry_uuid', data_1.uuid_v4()); | ||
| } | ||
| setGlobal(key, value) { | ||
| const existing = this.firstWhere('key', '=', key); | ||
| if (existing) { | ||
| existing.value = value; | ||
| } | ||
| else { | ||
| this.push({ key, value }); | ||
| } | ||
| return this; | ||
| } | ||
| getGlobal(key) { | ||
| var _a; | ||
| return (_a = this.firstWhere('key', '=', key)) === null || _a === void 0 ? void 0 : _a.value; | ||
| } | ||
| } | ||
| exports.GlobalRegistry = GlobalRegistry; | ||
| exports.globalRegistry = new GlobalRegistry(); |
+1
-0
@@ -21,1 +21,2 @@ export * from './cache/Cache'; | ||
| export * from './support/timeout'; | ||
| export * from './support/global'; |
+1
-0
@@ -33,1 +33,2 @@ "use strict"; | ||
| __exportStar(require("./support/timeout"), exports); | ||
| __exportStar(require("./support/global"), exports); |
+1
-1
| { | ||
| "name": "@extollo/util", | ||
| "version": "0.2.0", | ||
| "version": "0.3.0", | ||
| "description": "Utilities that lift up your code.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
139975
0.97%47
4.44%4075
0.99%3
-25%