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

brave-cache

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brave-cache - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

3

index.d.ts

@@ -72,4 +72,5 @@ import BraveCacheProvider from "./src/provider";

* @param set The value to set
* @param ttl The time to live in seconds
*/
getOrSet<Value = any>(key: string, set: Value | (() => Value)): Value;
getOrSet<Value = any>(key: string, set: Value | (() => Value), ttl?: number): Value;
/**

@@ -76,0 +77,0 @@ * Async: Find or create a value in the cache

@@ -162,8 +162,9 @@ "use strict";

* @param set The value to set
* @param ttl The time to live in seconds
*/
getOrSet(key, set) {
getOrSet(key, set, ttl) {
if (this.has(key))
return this.get(key);
const value = (0, functions_1.bc_getDefaultValue)(set);
this.set(key, value);
this.set(key, value, ttl);
return value;

@@ -170,0 +171,0 @@ }

{
"name": "brave-cache",
"version": "0.1.2",
"version": "0.1.3",
"description": "A flexible semantic Api for handling multiple node cache drivers.",

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

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