New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@appolo/cache

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@appolo/cache - npm Package Compare versions

Comparing version 7.0.5 to 7.0.6

8

module/src/cache.js

@@ -92,3 +92,3 @@ "use strict";

}
let value = this._needRefresh(result, args, key);
let value = this._needRefresh(result, args, key, !this._options.db);
return this._options.clone ? JSON.parse(value) : value;

@@ -114,3 +114,3 @@ }

}
_needRefresh(result, args, key) {
_needRefresh(result, args, key, refresh = true) {
if (!this._options.refresh) {

@@ -120,3 +120,3 @@ return result;

let value = result.value;
if (!result.validExpire) {
if (!result.validExpire && refresh) {
this._refreshValue(args, key);

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

let redisKey = this._getRedisKey(key), age = this._getRedisMaxAge();
let dto = { [ResultSymbol]: value };
let dto = value && value.hasOwnProperty && value.hasOwnProperty(ResultSymbol) ? value : { [ResultSymbol]: value };
return (this._options.maxAge ? this.redisProvider.setWithExpire(redisKey, dto, age) : this.redisProvider.set(redisKey, dto))

@@ -188,0 +188,0 @@ .catch(e => this.logger.error(`failed to set redis cache ${key}`, { e }));

@@ -147,3 +147,3 @@ import {define, initMethod, inject, injectLazy} from 'appolo';

let value = this._needRefresh(result, args, key);
let value = this._needRefresh(result, args, key, !this._options.db);

@@ -177,3 +177,3 @@ return this._options.clone ? JSON.parse(value) : value;

private _needRefresh(result: any, args: any[], key: string) {
private _needRefresh(result: any, args: any[], key: string, refresh: boolean = true) {
if (!this._options.refresh) {

@@ -185,3 +185,3 @@ return result;

if (!result.validExpire) {
if (!result.validExpire && refresh) {
this._refreshValue(args, key)

@@ -280,3 +280,3 @@ }

let dto = {[ResultSymbol]: value};
let dto = value && value.hasOwnProperty && value.hasOwnProperty(ResultSymbol) ? value : {[ResultSymbol]: value};

@@ -283,0 +283,0 @@ return (this._options.maxAge ? this.redisProvider.setWithExpire(redisKey, dto, age) : this.redisProvider.set(redisKey, dto))

{
"name": "@appolo/cache",
"version": "7.0.5",
"version": "7.0.6",
"description": "appolo cache module",

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

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