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

@soundxyz/fine-grained-cache

Package Overview
Dependencies
Maintainers
9
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@soundxyz/fine-grained-cache - npm Package Compare versions

Comparing version 2.1.1 to 2.2.0

7

dist/fineGrained.d.ts

@@ -45,3 +45,3 @@ import type { Redis } from "ioredis";

};
export declare type LoggedEvents = Partial<Record<Events, string | boolean | null>>;
export declare type LoggedEvents = Partial<Record<Events, string | boolean | null | ((args: LogEventArgs) => void)>>;
export declare function FineGrainedCache({ redis, redLock: redLockConfig, keyPrefix, memoryCache, onError, logEvents, GETRedisTimeout, pipelineRedisGET, pipelineRedisSET, defaultUseMemoryCache, awaitRedisSet, }: {

@@ -65,4 +65,7 @@ redis: Redis;

logEvents?: {
log: (args: LogEventArgs) => void;
events: LoggedEvents;
/**
* @default console.log
*/
log?: (args: LogEventArgs) => void;
};

@@ -69,0 +72,0 @@ /**

@@ -50,2 +50,5 @@ 'use strict';

};
function defaultLog({ message }) {
console.log(message);
}
function FineGrainedCache({

@@ -77,7 +80,7 @@ redis,

const logMessage = logEvents ? function logMessage2(code, params) {
let codeValue = logEvents.events[code];
if (!codeValue)
const eventValue = logEvents.events[code];
if (!eventValue)
return;
if (typeof codeValue !== "string")
codeValue = Events[code];
const log = typeof eventValue === "function" ? eventValue : logEvents.log || defaultLog;
const codeMessageValue = typeof eventValue === "string" ? eventValue : code;
let paramsString = "";

@@ -92,5 +95,5 @@ for (const key in params) {

}
logEvents.log({
log({
code,
message: `[${codeValue}]${paramsString}`,
message: `[${codeMessageValue}]${paramsString}`,
params

@@ -387,3 +390,3 @@ });

if (expirySeconds > 0) {
if (pipelineRedisSET != null) {
if (pipelineRedisSET) {
const set = pipelinedRedisSet({

@@ -412,3 +415,3 @@ key,

} else if (ttl === "Infinity") {
if (pipelineRedisSET != null) {
if (pipelineRedisSET) {
const set = pipelinedRedisSet({

@@ -415,0 +418,0 @@ key,

{
"name": "@soundxyz/fine-grained-cache",
"version": "2.1.1",
"version": "2.2.0",
"description": "Fine-grained cache helper using redis",

@@ -46,2 +46,3 @@ "keywords": [

"concurrently": "^7.2.1",
"date-fns": "^2.29.1",
"esbuild": "^0.14.42",

@@ -48,0 +49,0 @@ "execa": "^6.1.0",

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