Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@meteor-it/utils

Package Overview
Dependencies
Maintainers
2
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@meteor-it/utils - npm Package Compare versions

Comparing version 1.3.31 to 1.3.33

26

index.d.ts

@@ -122,1 +122,27 @@ /// <reference types="node" />

}
export declare type MaybePromise<T> = Promise<T> | T;
export declare function isPromise<T>(val: MaybePromise<T>): val is Promise<T>;
/**
* Simple, never expiring in-memory cache
*/
export declare abstract class PromiseMap<K, V> {
flushEvent: TypedEvent<[K, V | null]>;
populateEvent: TypedEvent<[K, V | null]>;
protected abstract getPromise(key: K): Promise<V | null>;
protected normalizeKey: ((key: K) => K) | null;
protected normalizeValue: ((value: V) => V) | null;
protected map: Map<K, Promise<V | null>>;
protected resolvedMap: Map<K, V | null>;
getIfResolvedPresent(key: K): V | null;
getIfResolvingOrResolvedPresent(key: K): MaybePromise<V | null>;
delete(key: K): boolean;
getAll: (keys: K[]) => MaybePromise<(V | null)[]>;
/**
* Works great with collapsing queue
*
* @param keys
*/
protected _getAll(keys: K[]): MaybePromise<(V | null)[]>;
get: (key: K) => MaybePromise<V | null>;
protected _get(key: K): MaybePromise<V | null>;
}

94

index.js

@@ -425,3 +425,95 @@ "use strict";

exports.TypedEvent = TypedEvent;
function isPromise(val) {
return val instanceof Promise;
}
exports.isPromise = isPromise;
/**
* Simple, never expiring in-memory cache
*/
class PromiseMap {
constructor() {
this.flushEvent = new TypedEvent();
this.populateEvent = new TypedEvent();
this.normalizeKey = null;
this.normalizeValue = null;
this.map = new Map();
this.resolvedMap = new Map();
this.getAll = this._getAll;
this.get = this._get;
}
getIfResolvedPresent(key) {
var _a;
if (this.normalizeKey)
key = this.normalizeKey(key);
return _a = this.resolvedMap.get(key), (_a !== null && _a !== void 0 ? _a : null);
}
getIfResolvingOrResolvedPresent(key) {
if (this.normalizeKey)
key = this.normalizeKey(key);
const resolved = this.resolvedMap.get(key);
if (resolved)
return resolved;
const resolving = this.map.get(key);
if (resolving)
return resolving;
return null;
}
delete(key) {
if (this.normalizeKey)
key = this.normalizeKey(key);
let found = this.map.delete(key);
let oldValue;
if (this.resolvedMap.has(key))
oldValue = this.resolvedMap.get(key);
if (this.resolvedMap.delete(key))
found = true;
if (oldValue !== undefined)
this.flushEvent.emit([key, oldValue]);
return found;
}
/**
* Works great with collapsing queue
*
* @param keys
*/
_getAll(keys) {
const promises = [];
const results = new Array(keys.length);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
if (this.normalizeKey)
key = this.normalizeKey(key);
results[i] = this.resolvedMap.get(key);
if (results[i] === undefined) {
promises.push(this.get(key).then(v => {
results[i] = v;
}));
}
}
if (promises.length === 0)
return results;
return Promise.all(promises).then(() => results);
}
_get(key) {
if (this.normalizeKey)
key = this.normalizeKey(key);
if (this.resolvedMap.has(key))
return this.resolvedMap.get(key);
if (!this.map.has(key)) {
const promise = this.getPromise(key).then(v => (v !== null && this.normalizeValue) ? this.normalizeValue(v) : v);
this.map.set(key, promise);
promise.then(v => {
this.map.delete(key);
this.resolvedMap.set(key, v);
this.populateEvent.emit([key, v]);
});
promise.catch(_e => {
this.map.delete(key);
});
}
return this.map.get(key);
}
}
exports.PromiseMap = PromiseMap;
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInhyZXN0L25vZGVfbW9kdWxlcy9AbWV0ZW9yLWl0L3V0aWxzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsbUNBQWtDO0FBRWxDLHFDQUFxQztBQUNyQyxTQUFnQixnQkFBZ0IsQ0FBQyxNQUFjLEVBQUUsT0FBTyxHQUFHLEVBQUU7SUFDekQsT0FBTyxJQUFJLFdBQVcsQ0FBQyxNQUFNLEVBQUUsT0FBTyxDQUFDLENBQUM7QUFDNUMsQ0FBQztBQUZELDRDQUVD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XG5cbi8qKlxuICogQGRlcHJlY2F0ZWRcbiAqIEBwYXJhbSBhcnJheVxuICovXG5leHBvcnQgZnVuY3Rpb24gcmVtb3ZlRHVwbGljYXRlczxUPihhcnJheTogVFtdKTogVFtdIHtcbiAgICByZXR1cm4gQXJyYXkuZnJvbShuZXcgU2V0KGFycmF5KSk7XG59XG5cbi8qKlxuICogQGRlcHJlY2F0ZWRcbiAqIEBwYXJhbSBhcnJheTFcbiAqIEBwYXJhbSBhcnJheTJcbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIG1peChhcnJheTE6IGFueVtdIHwgT2JqZWN0LCBhcnJheTI6IGFueVtdIHwgT2JqZWN0KTogYW55IHtcbiAgICBsZXQgb3V0OiBhbnk7XG4gICAgaWYgKGFycmF5MSBpbnN0YW5jZW9mIEFycmF5KSB7XG4gICAgICAgIG91dCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpbmRleCBpbiBhcnJheTEpIHtcbiAgICAgICAgICAgIG91dC5wdXNoKFthcnJheTFbaW5kZXhdLCAoYXJyYXkyIGFzIGFueSlbaW5kZXhdXSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG91dDtcbiAgICB9IGVsc2Uge1xuICAgICAgICBvdXQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQga2V5IGluIGFycmF5MSkge1xuICAgICAgICAgICAgLy8gbm9pbnNwZWN0aW9uIEpTVW5maWx0ZXJlZEZvckluTG9vcFxuICAgICAgICAgICAgb3V0W2tleV0gPSAoYXJyYXkxIGFzIGFueSlba2V5XTtcbiAgICAgICAgfVxuICAgICAgICBmb3IgKGxldCBrZXkgaW4gYXJyYXkyKSB7XG4gICAgICAgICAgICAvLyBub2luc3BlY3Rpb24gSlNVbmZpbHRlcmVkRm9ySW5Mb29wXG4gICAgICAgICAgICBvdXRba2V5XSA9IChhcnJheTIgYXMgYW55KVtrZXldO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBvdXQ7XG4gICAgfVxufVxuXG4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c3Bvc2FibGUge1xuICAgICAgICB0aGlzLmxpc3RlbmVycy5wdXNoKGxpc3RlbmVyKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIGRpc3Bvc2U6ICgpID0+IHRoaXMub2ZmKGxpc3RlbmVyKVxuICAgICAgICB9O1xuICAgIH1cblxuICAgIG9uY2UobGlzdGVuZXI6IExpc3RlbmVyPFQ+KTogdm9pZCB7XG4gICAgICAgIHRoaXMubGlzdGVuZXJzT25jZXIucHVzaChsaXN0ZW5lcik7XG4gICAgfVxuXG4gICAgb2ZmKGxpc3RlbmVyOiBMaXN0ZW5lcjxUPikge1xuICAgICAgICB2YXIgY2FsbGJhY2tJbmRleCA9IHRoaXMubGlzdGVuZXJzLmluZGV4T2YobGlzdGVuZXIpO1xuICAgICAgICBpZiAoY2FsbGJhY2tJbmRleCA+IC0xKSB0aGlzLmxpc3RlbmVycy5zcGxpY2UoY2FsbGJhY2tJbmRleCwgMSk7XG4gICAgfVxuXG4gICAgZW1pdChldmVudDogVCkge1xuICAgICAgICB0aGlzLmxpc3RlbmVycy5mb3JFYWNoKChsaXN0ZW5lcikgPT4gbGlzdGVuZXIoZXZlbnQpKTtcbiAgICAgICAgaWYgKHRoaXMubGlzdGVuZXJzT25jZXIubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgY29uc3QgdG9DYWxsID0gdGhpcy5saXN0ZW5lcnNPbmNlcjtcbiAgICAgICAgICAgIHRoaXMubGlzdGVuZXJzT25jZXIgPSBbXTtcbiAgICAgICAgICAgIHRvQ2FsbC5mb3JFYWNoKChsaXN0ZW5lcikgPT4gbGlzdGVuZXIoZXZlbnQpKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBwaXBlKHRlOiBUeXBlZEV2ZW50PFQ+KTogRGlzcG9zYWJsZSB7XG4gICAgICAgIHJldHVybiB0aGlzLm9uKChlKSA9PiB0ZS5lbWl0KGUpKTtcbiAgICB9XG59XG4iXX0=
//# sourceMappingURL=data:application/json;charset=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HBvcnQgZnVuY3Rpb24gZmxhdHRlbihhcnJheTogYW55W10sIHJlc3VsdDogYW55W10gPSBbXSk6IGFueVtdIHtcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFycmF5Lmxlbmd0aDsgaSsrKSB7XG4gICAgICAgIGNvbnN0IHZhbHVlID0gYXJyYXlbaV07XG5cbiAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkodmFsdWUpKSB7XG4gICAgICAgICAgICBmbGF0dGVuKHZhbHVlLCByZXN1bHQpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcmVzdWx0LnB1c2godmFsdWUpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIHJlc3VsdDtcbn1cblxuLyoqXG4gKiBAZGVwcmVjYXRlZFxuICogQHBhcmFtIGFycmF5XG4gKi9cbmV4cG9ydCBmdW5jdGlvbiByZW1vdmVEdXBsaWNhdGVzPFQ+KGFycmF5OiBUW10pOiBUW10ge1xuICAgIHJldHVybiBBcnJheS5mcm9tKG5ldyBTZXQoYXJyYXkpKTtcbn1cblxuLyoqXG4gKiBAZGVwcmVjYXRlZFxuICogQHBhcmFtIGFycmF5MVxuICogQHBhcmFtIGFycmF5MlxuICovXG5leHBvcnQgZnVuY3Rpb24gbWl4KGFycmF5MTogYW55W10gfCBPYmplY3QsIGFycmF5MjogYW55W10gfCBPYmplY3QpOiBhbnkge1xuICAgIGxldCBvdXQ6IGFueTtcbiAgICBpZiAoYXJyYXkxIGluc3RhbmNlb2YgQXJyYXkpIHtcbiAgICAgICAgb3V0ID0gW107XG4gICAgICAgIGZvciAobGV0IGluZGV4IGluIGFycmF5MSkge1xuICAgICAgICAgICAgb3V0LnB1c2goW2FycmF5MVtpbmRleF0sIChhcnJheTIgYXMgYW55KVtpbmRleF1dKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gb3V0O1xuICAgIH0gZWxzZSB7XG4gICAgICAgIG91dCA9IHt9O1xuICAg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6IFQpID0+IHZvaWQpID0+IFByb21pc2U8dm9pZD4pOiBQcm9taXNlPFRbXT4ge1xuICAgIGNvbnN0IG91dHB1dDogVFtdID0gW107XG4gICAgY29uc3QgY29sbGVjdG9yID0gKHY6IFQpID0+IG91dHB1dC5wdXNoKHYpO1xuICAgIGF3YWl0IGNiUHJvdmlkZXIoY29sbGVjdG9yKTtcbiAgICByZXR1cm4gb3V0cHV0O1xufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gcmVwZWF0QmVmb3JlU3VjY2VlZDxWPihmbjogKCkgPT4gUHJvbWlzZTxWPiwgbWF4UmVwZWF0czogbnVtYmVyLCByZXBlYXRJbjogbnVtYmVyLCB0aW1lTXVsdGlwbGllcjogbnVtYmVyID0gMSwgbWF4VGltZT86IG51bWJlcik6IFByb21pc2U8Vj4ge1xuICAgIGxldCByZXBlYXQgPSAwO1xuICAgIGlmICh0aW1lTXVsdGlwbGllciA8IDEpIHRocm93IG5ldyBFcnJvcihgdGltZU11bHRpcGxpZXIgKD0gJHt0aW1lTXVsdGlwbGllcn0pIDwgMSBtYWtlcyBubyBzZW5zZWApO1xuICAgIHdoaWxlICh0cnVlKSB7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICByZXR1cm4gYXdhaXQgZm4oKTtcbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgaWYgKHJlcGVhdCA+PSBtYXhSZXBlYXRzKVxuICAgICAgICAgICAgICAgIHRocm93IGU7XG4gICAgICAgICAgICBpZiAocmVwZWF0ICE9PSAwICYmIHRpbWVNdWx0aXBsaWVyICE9IDEpIHtcbiAgICAgICAgICAgICAgICByZXBlYXRJbiA9IE1hdGgubWluKHJlcGVhdEluICogdGltZU11bHRpcGxpZXIsIG1heFRpbWUgPz8gSW5maW5pdHkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYXdhaXQgc2xlZXAocmVwZWF0SW4pO1xuICAgICAgICB9XG4gICAgICAgIHJlcGVhdC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tpXSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgcHJvbWlzZXMucHVzaCgodGhpcy5nZXQoa2V5KSBhcyBQcm9taXNlPFYgfCBudWxsPikudGhlbih2ID0+IHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0c1tpXSA9IHY7XG4gICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChwcm9taXNlcy5sZW5ndGggPT09IDApXG4gICAgICAgICAgICByZXR1cm4gcmVzdWx0cyBhcyAoViB8IG51bGwpW107XG4gICAgICAgIHJldHVybiBQcm9taXNlLmFsbChwcm9taXNlcykudGhlbigoKSA9PiByZXN1bHRzIGFzIChWIHwgbnVsbClbXSk7XG4gICAgfVxuXG4gICAgZ2V0OiAoa2V5OiBLKSA9PiBNYXliZVByb21pc2U8ViB8IG51bGw+ID0gdGhpcy5fZ2V0O1xuXG4gICAgcHJvdGVjdGVkIF9nZXQoa2V5OiBLKTogTWF5YmVQcm9taXNlPFYgfCBudWxsPiB7XG4gICAgICAgIGlmICh0aGlzLm5vcm1hbGl6ZUtleSkga2V5ID0gdGhpcy5ub3JtYWxpemVLZXkoa2V5KTtcbiAgICAgICAgaWYgKHRoaXMucmVzb2x2ZWRNYXAuaGFzKGtleSkpXG4gICAgICAgICAgICByZXR1cm4gdGhpcy5yZXNvbHZlZE1hcC5nZXQoa2V5KSE7XG4gICAgICAgIGlmICghdGhpcy5tYXAuaGFzKGtleSkpIHtcbiAgICAgICAgICAgIGNvbnN0IHByb21pc2UgPSB0aGlzLmdldFByb21pc2Uoa2V5KS50aGVuKHYgPT4gKHYgIT09IG51bGwgJiYgdGhpcy5ub3JtYWxpemVWYWx1ZSkgPyB0aGlzLm5vcm1hbGl6ZVZhbHVlKHYpIDogdik7XG4gICAgICAgICAgICB0aGlzLm1hcC5zZXQoa2V5LCBwcm9taXNlKTtcbiAgICAgICAgICAgIHByb21pc2UudGhlbih2ID0+IHtcbiAgICAgICAgICAgICAgICB0aGlzLm1hcC5kZWxldGUoa2V5KTtcbiAgICAgICAgICAgICAgICB0aGlzLnJlc29sdmVkTWFwLnNldChrZXksIHYpO1xuICAgICAgICAgICAgICAgIHRoaXMucG9wdWxhdGVFdmVudC5lbWl0KFtrZXksIHZdKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgcHJvbWlzZS5jYXRjaChfZSA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcy5tYXAuZGVsZXRlKGtleSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5tYXAuZ2V0KGtleSkhO1xuICAgIH1cbn1cbiJdfQ==

@@ -436,1 +436,95 @@ import { Readable } from 'stream';

}
export type MaybePromise<T> = Promise<T> | T;
export function isPromise<T>(val: MaybePromise<T>): val is Promise<T> {
return val instanceof Promise;
}
/**
* Simple, never expiring in-memory cache
*/
export abstract class PromiseMap<K, V> {
flushEvent: TypedEvent<[K, V | null]> = new TypedEvent();
populateEvent: TypedEvent<[K, V | null]> = new TypedEvent();
protected abstract getPromise(key: K): Promise<V | null>;
protected normalizeKey: ((key: K) => K) | null = null;
protected normalizeValue: ((value: V) => V) | null = null;
protected map: Map<K, Promise<V | null>> = new Map();
protected resolvedMap: Map<K, V | null> = new Map();
getIfResolvedPresent(key: K): V | null {
if (this.normalizeKey) key = this.normalizeKey(key);
return this.resolvedMap.get(key) ?? null;
}
getIfResolvingOrResolvedPresent(key: K): MaybePromise<V | null> {
if (this.normalizeKey) key = this.normalizeKey(key);
const resolved = this.resolvedMap.get(key);
if (resolved) return resolved;
const resolving = this.map.get(key);
if (resolving) return resolving;
return null;
}
delete(key: K): boolean {
if (this.normalizeKey) key = this.normalizeKey(key);
let found = this.map.delete(key);
let oldValue;
if (this.resolvedMap.has(key))
oldValue = this.resolvedMap.get(key);
if (this.resolvedMap.delete(key)) found = true;
if (oldValue !== undefined)
this.flushEvent.emit([key, oldValue]);
return found;
}
getAll: (keys: K[]) => MaybePromise<(V | null)[]> = this._getAll;
/**
* Works great with collapsing queue
*
* @param keys
*/
protected _getAll(keys: K[]): MaybePromise<(V | null)[]> {
const promises: Promise<void>[] = [];
const results: (V | null | undefined)[] = new Array(keys.length);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
if (this.normalizeKey) key = this.normalizeKey(key);
results[i] = this.resolvedMap.get(key);
if (results[i] === undefined) {
promises.push((this.get(key) as Promise<V | null>).then(v => {
results[i] = v;
}));
}
}
if (promises.length === 0)
return results as (V | null)[];
return Promise.all(promises).then(() => results as (V | null)[]);
}
get: (key: K) => MaybePromise<V | null> = this._get;
protected _get(key: K): MaybePromise<V | null> {
if (this.normalizeKey) key = this.normalizeKey(key);
if (this.resolvedMap.has(key))
return this.resolvedMap.get(key)!;
if (!this.map.has(key)) {
const promise = this.getPromise(key).then(v => (v !== null && this.normalizeValue) ? this.normalizeValue(v) : v);
this.map.set(key, promise);
promise.then(v => {
this.map.delete(key);
this.resolvedMap.set(key, v);
this.populateEvent.emit([key, v]);
});
promise.catch(_e => {
this.map.delete(key);
});
}
return this.map.get(key)!;
}
}

32

package.json
{
"name": "@meteor-it/utils",
"version": "1.3.31",
"description": "Many useful utils",
"module": "index.mjs",
"main": "index.js",
"keywords": [
"meteor-it",
"utils"
],
"author": "CertainLach <iam@lach.pw>",
"license": "MIT",
"sideEffects": false,
"publishConfig": {
"access": "public"
},
"gitHead": "5b9446f8625a2fee5a1204b1330383e515c6ec14"
"name": "@meteor-it/utils",
"version": "1.3.33",
"description": "Many useful utils",
"module": "index.mjs",
"main": "index.js",
"keywords": [
"meteor-it",
"utils"
],
"author": "CertainLach <iam@lach.pw>",
"license": "MIT",
"sideEffects": false,
"publishConfig": {
"access": "public"
},
"gitHead": "8f833b33d2b2da88753640cf0bc9d2bca3b23fde"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc