@algolia/cache-in-memory
Advanced tools
Comparing version 4.0.0-beta.11 to 4.0.0-beta.12
@@ -6,3 +6,2 @@ 'use strict'; | ||
function createInMemoryCache(options = { serializable: true }) { | ||
/* eslint-disable functional/immutable-data, functional/no-let, functional/prefer-readonly-type */ | ||
const cache = {}; | ||
@@ -22,2 +21,3 @@ return { | ||
set(key, value) { | ||
// eslint-disable-next-line functional/immutable-data | ||
cache[JSON.stringify(key)] = options.serializable ? JSON.stringify(value) : value; | ||
@@ -27,2 +27,3 @@ return Promise.resolve(value); | ||
delete(key) { | ||
// eslint-disable-next-line functional/immutable-data | ||
delete cache[JSON.stringify(key)]; | ||
@@ -29,0 +30,0 @@ return Promise.resolve(); |
@@ -6,2 +6,5 @@ import { Cache } from '@algolia/cache-common'; | ||
export declare type InMemoryCacheOptions = { | ||
/** | ||
* If keys and values should be serialized using `JSON.stringify`. | ||
*/ | ||
readonly serializable?: boolean; | ||
@@ -8,0 +11,0 @@ }; |
function createInMemoryCache(options = { serializable: true }) { | ||
/* eslint-disable functional/immutable-data, functional/no-let, functional/prefer-readonly-type */ | ||
const cache = {}; | ||
@@ -17,2 +16,3 @@ return { | ||
set(key, value) { | ||
// eslint-disable-next-line functional/immutable-data | ||
cache[JSON.stringify(key)] = options.serializable ? JSON.stringify(value) : value; | ||
@@ -22,2 +22,3 @@ return Promise.resolve(value); | ||
delete(key) { | ||
// eslint-disable-next-line functional/immutable-data | ||
delete cache[JSON.stringify(key)]; | ||
@@ -24,0 +25,0 @@ return Promise.resolve(); |
{ | ||
"name": "@algolia/cache-in-memory", | ||
"version": "4.0.0-beta.11", | ||
"version": "4.0.0-beta.12", | ||
"private": false, | ||
@@ -16,4 +16,4 @@ "description": "Promise-based cache library using memory.", | ||
"dependencies": { | ||
"@algolia/cache-common": "4.0.0-beta.11" | ||
"@algolia/cache-common": "4.0.0-beta.12" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3225
67
+ Added@algolia/cache-common@4.0.0-beta.12(transitive)
- Removed@algolia/cache-common@4.0.0-beta.11(transitive)