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

thingies

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

thingies - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

es2020/LruTtlMap.d.ts

8

es2020/LruMap.d.ts

@@ -7,9 +7,1 @@ export declare class LruMap<K, V> extends Map<K, V> {

}
export declare class LruTtlMap<K, V> extends LruMap<K, V> {
private readonly expiry;
clear(): void;
delete(key: K): boolean;
has(key: K, now?: number): boolean;
get(key: K, now?: number): V | undefined;
set(key: K, value: V, expiry?: number): this;
}

38

es2020/LruMap.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LruTtlMap = exports.LruMap = void 0;
exports.LruMap = void 0;
class LruMap extends Map {

@@ -25,37 +25,1 @@ constructor(limit = Infinity) {

exports.LruMap = LruMap;
class LruTtlMap extends LruMap {
constructor() {
super(...arguments);
this.expiry = new Map();
}
clear() {
this.expiry.clear();
super.clear();
}
delete(key) {
this.expiry.delete(key);
return super.delete(key);
}
has(key, now = 0) {
if (!super.has(key))
return false;
const expiry = this.expiry.get(key) || 0;
const expired = now > expiry;
if (expired)
this.delete(key);
return !expired;
}
get(key, now) {
if (!this.has(key, now))
return undefined;
const value = super.get(key);
super.set(key, value);
return value;
}
set(key, value, expiry = Infinity) {
super.set(key, value);
this.expiry.set(key, expiry);
return this;
}
}
exports.LruTtlMap = LruTtlMap;

@@ -7,9 +7,1 @@ export declare class LruMap<K, V> extends Map<K, V> {

}
export declare class LruTtlMap<K, V> extends LruMap<K, V> {
private readonly expiry;
clear(): void;
delete(key: K): boolean;
has(key: K, now?: number): boolean;
get(key: K, now?: number): V | undefined;
set(key: K, value: V, expiry?: number): this;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LruTtlMap = exports.LruMap = void 0;
exports.LruMap = void 0;
class LruMap extends Map {

@@ -25,37 +25,1 @@ constructor(limit = Infinity) {

exports.LruMap = LruMap;
class LruTtlMap extends LruMap {
constructor() {
super(...arguments);
this.expiry = new Map();
}
clear() {
this.expiry.clear();
super.clear();
}
delete(key) {
this.expiry.delete(key);
return super.delete(key);
}
has(key, now = 0) {
if (!super.has(key))
return false;
const expiry = this.expiry.get(key) || 0;
const expired = now > expiry;
if (expired)
this.delete(key);
return !expired;
}
get(key, now) {
if (!this.has(key, now))
return undefined;
const value = super.get(key);
super.set(key, value);
return value;
}
set(key, value, expiry = Infinity) {
super.set(key, value);
this.expiry.set(key, expiry);
return this;
}
}
exports.LruTtlMap = LruTtlMap;

@@ -7,9 +7,1 @@ export declare class LruMap<K, V> extends Map<K, V> {

}
export declare class LruTtlMap<K, V> extends LruMap<K, V> {
private readonly expiry;
clear(): void;
delete(key: K): boolean;
has(key: K, now?: number): boolean;
get(key: K, now?: number): V | undefined;
set(key: K, value: V, expiry?: number): this;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LruTtlMap = exports.LruMap = void 0;
exports.LruMap = void 0;
class LruMap extends Map {

@@ -25,37 +25,1 @@ constructor(limit = Infinity) {

exports.LruMap = LruMap;
class LruTtlMap extends LruMap {
constructor() {
super(...arguments);
this.expiry = new Map();
}
clear() {
this.expiry.clear();
super.clear();
}
delete(key) {
this.expiry.delete(key);
return super.delete(key);
}
has(key, now = 0) {
if (!super.has(key))
return false;
const expiry = this.expiry.get(key) || 0;
const expired = now > expiry;
if (expired)
this.delete(key);
return !expired;
}
get(key, now) {
if (!this.has(key, now))
return undefined;
const value = super.get(key);
super.set(key, value);
return value;
}
set(key, value, expiry = Infinity) {
super.set(key, value);
this.expiry.set(key, expiry);
return this;
}
}
exports.LruTtlMap = LruTtlMap;
{
"name": "thingies",
"version": "1.0.0",
"version": "1.1.0",
"description": "",

@@ -5,0 +5,0 @@ "author": {

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