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

@nrk/nodecache-as-promised

Package Overview
Dependencies
Maintainers
21
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nrk/nodecache-as-promised - npm Package Compare versions

Comparing version 1.0.8 to 1.0.9

.nyc_output/4ba8bfc61d34a665d445f0b04f262106.json

5

lib/index.js

@@ -116,3 +116,3 @@ 'use strict';

const set = (key, value, ttl = DEFAULT_CACHE_EXPIRE) => {
cache.set(key, _extends({}, (0, _cacheHelpers.createEntry)(value, ttl), { cache: CACHE_HIT }));
cache.set(key, _extends({}, (0, _cacheHelpers.createEntry)(value, ttl), { cache: CACHE_HIT }), maxAge);
};

@@ -198,3 +198,3 @@

return Promise.resolve(obj);
} else if (obj && (!worker || (0, _cacheHelpers.isWaiting)(waiting.get(key)))) {
} else if (obj && (0, _cacheHelpers.isWaiting)(waiting.get(key))) {
return Promise.resolve(_extends({}, obj, { cache: CACHE_STALE }));

@@ -279,3 +279,2 @@ } else if ((0, _cacheHelpers.isWaiting)(waiting.get(key))) {

return new Map(keys().reduce((acc, key, i) => {
// console.log({[key]: vals[i]})
acc.push([key, vals[i]]);

@@ -282,0 +281,0 @@ return acc;

@@ -32,24 +32,2 @@ 'use strict';

/*
export const existsAndNotStale = (entry, wait, nowDefault) => {
const now = nowDefault || Date.now()
let remainingToWait = 0
if (wait) {
remainingToWait = wait.started + wait.wait - now
}
if (remainingToWait > 0) {
return true
}
if (entry) {
return entry.created + entry.TTL > now
}
return false
}
export const finishedWaiting = (waiting) => {
return waiting ? waiting.waitUntil < Date.now() : true
}
*/
const waitingForError = exports.waitingForError = (key, wait = {}) => {

@@ -56,0 +34,0 @@ return new Error(`Waiting for next run for ${key}, wait: ${JSON.stringify(wait, null, 2)}`);

2

package.json

@@ -9,3 +9,3 @@ {

"homepage": "https://github.com/nrkno/nodecache-as-promised#readme",
"version": "1.0.8",
"version": "1.0.9",
"description": "NodeJs in-memory cache with Promise support. Extendable with middlewares. Middlewares provided: Distributed invalidation and persistence of cache misses",

@@ -12,0 +12,0 @@ "main": "lib/index.js",

@@ -101,3 +101,3 @@ /**

const set = (key, value, ttl = DEFAULT_CACHE_EXPIRE) => {
cache.set(key, {...createEntry(value, ttl), cache: CACHE_HIT})
cache.set(key, {...createEntry(value, ttl), cache: CACHE_HIT}, maxAge)
}

@@ -185,3 +185,3 @@

return Promise.resolve(obj)
} else if (obj && (!worker || isWaiting(waiting.get(key)))) {
} else if (obj && isWaiting(waiting.get(key))) {
return Promise.resolve({...obj, cache: CACHE_STALE})

@@ -266,3 +266,2 @@ } else if (isWaiting(waiting.get(key))) {

return new Map(keys().reduce((acc, key, i) => {
// console.log({[key]: vals[i]})
acc.push([key, vals[i]])

@@ -269,0 +268,0 @@ return acc

@@ -32,24 +32,2 @@ /**

/*
export const existsAndNotStale = (entry, wait, nowDefault) => {
const now = nowDefault || Date.now()
let remainingToWait = 0
if (wait) {
remainingToWait = wait.started + wait.wait - now
}
if (remainingToWait > 0) {
return true
}
if (entry) {
return entry.created + entry.TTL > now
}
return false
}
export const finishedWaiting = (waiting) => {
return waiting ? waiting.waitUntil < Date.now() : true
}
*/
export const waitingForError = (key, wait = {}) => {

@@ -56,0 +34,0 @@ return new Error(`Waiting for next run for ${key}, wait: ${JSON.stringify(wait, null, 2)}`)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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