Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@extollo/util

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@extollo/util - npm Package Compare versions

Comparing version
0.2.0
to
0.3.0
+11
lib/support/global.d.ts
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';

@@ -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",