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

another-cache-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

another-cache-wrapper - npm Package Compare versions

Comparing version 1.0.22 to 1.0.23

2

dist/index.d.ts

@@ -16,2 +16,2 @@ /**

export declare function cacheKey(key: any, prefixes?: string[] | string): string;
export declare function cachedMethodCall(prefix: string[] | string, method: () => any, keyExtractor?: () => any, ttl?: number): () => Promise<any>;
export declare function cachedMethodCall(prefix: string[] | string, method: () => any, keyExtractor?: () => any, ttl?: number, thisArg?: any): () => Promise<any>;

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

exports.cacheKey = cacheKey;
function cachedMethodCall(prefix, method, keyExtractor = index_1.default.identity, ttl = exports.DEFAULT_TTL) {
function cachedMethodCall(prefix, method, keyExtractor = index_1.default.identity, ttl = exports.DEFAULT_TTL, thisArg = null) {
return function () {

@@ -51,3 +51,3 @@ return __awaiter(this, arguments, void 0, function* () {

// fallback to call unwrapped method
return method.apply(null, args);
return method.apply(thisArg, args);
}

@@ -65,3 +65,3 @@ // workout cache key for this params

// otherwise call the function
const liveResult = yield index_1.default.attempt(method, args);
const liveResult = yield index_1.default.attempt(index_1.default.bind(method, thisArg, args));
// if it raises an error

@@ -68,0 +68,0 @@ if (index_1.default.isError(liveResult)) {

{
"name": "another-cache-wrapper",
"version": "1.0.22",
"version": "1.0.23",
"description": "custom cache interface",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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