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

tmp-cache

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tmp-cache - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

index.d.ts

3

lib/index.js

@@ -19,5 +19,4 @@ class Cache extends Map {

set(key, content, maxAge) {
set(key, content, maxAge = this.maxAge) {
this.has(key) && this.delete(key);
maxAge = maxAge !== void 0 ? maxAge : this.maxAge;
(this.size + 1 > this.max) && this.delete(this.keys().next().value);

@@ -24,0 +23,0 @@ let expires = maxAge > -1 && (maxAge + Date.now());

{
"name": "tmp-cache",
"version": "1.0.0",
"version": "1.1.0",
"repository": "lukeed/tmp-cache",
"description": "A least-recently-used cache manager in 35 lines of code",
"description": "A least-recently-used cache in 35 lines of code",
"main": "lib/index.js",
"types": "index.d.ts",
"license": "MIT",

@@ -11,3 +12,3 @@ "author": {

"email": "luke.edwards05@gmail.com",
"url": "lukeed.com"
"url": "https://lukeed.com"
},

@@ -18,5 +19,6 @@ "engines": {

"scripts": {
"test": "tape test/*.js | tap-spec"
"test": "uvu test"
},
"files": [
"*.d.ts",
"lib"

@@ -31,5 +33,4 @@ ],

"devDependencies": {
"tap-spec": "^4.1.1",
"tape": "^4.8.0"
"uvu": "0.3.3"
}
}

@@ -1,4 +0,4 @@

# tmp-cache [![Build Status](https://travis-ci.org/lukeed/tmp-cache.svg?branch=master)](https://travis-ci.org/lukeed/tmp-cache)
# tmp-cache ![CI](https://github.com/lukeed/tmp-cache/workflows/CI/badge.svg) [![codecov](https://badgen.net/codecov/c/github/lukeed/tmp-cache)](https://codecov.io/gh/lukeed/tmp-cache)
> A least-recently-used cache manager in 35 lines of code~!
> A least-recently-used cache in 35 lines of code~!

@@ -5,0 +5,0 @@ LRU caches operate on a first-in-first-out queue. This means that the first item is the oldest and will therefore be deleted once the `max` limit has been reached.

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