deploy: ebd4cc0010
This commit is contained in:
37
node_modules/@algolia/cache-in-memory/dist/cache-in-memory.cjs.js
generated
vendored
37
node_modules/@algolia/cache-in-memory/dist/cache-in-memory.cjs.js
generated
vendored
@@ -1,37 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
function createInMemoryCache(options = { serializable: true }) {
|
||||
// eslint-disable-next-line functional/no-let
|
||||
let cache = {};
|
||||
return {
|
||||
get(key, defaultValue, events = {
|
||||
miss: () => Promise.resolve(),
|
||||
}) {
|
||||
const keyAsString = JSON.stringify(key);
|
||||
if (keyAsString in cache) {
|
||||
return Promise.resolve(options.serializable ? JSON.parse(cache[keyAsString]) : cache[keyAsString]);
|
||||
}
|
||||
const promise = defaultValue();
|
||||
const miss = (events && events.miss) || (() => Promise.resolve());
|
||||
return promise.then((value) => miss(value)).then(() => promise);
|
||||
},
|
||||
set(key, value) {
|
||||
// eslint-disable-next-line functional/immutable-data
|
||||
cache[JSON.stringify(key)] = options.serializable ? JSON.stringify(value) : value;
|
||||
return Promise.resolve(value);
|
||||
},
|
||||
delete(key) {
|
||||
// eslint-disable-next-line functional/immutable-data
|
||||
delete cache[JSON.stringify(key)];
|
||||
return Promise.resolve();
|
||||
},
|
||||
clear() {
|
||||
cache = {};
|
||||
return Promise.resolve();
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
exports.createInMemoryCache = createInMemoryCache;
|
||||
12
node_modules/@algolia/cache-in-memory/dist/cache-in-memory.d.ts
generated
vendored
12
node_modules/@algolia/cache-in-memory/dist/cache-in-memory.d.ts
generated
vendored
@@ -1,12 +0,0 @@
|
||||
import { Cache } from '@algolia/cache-common';
|
||||
|
||||
export declare function createInMemoryCache(options?: InMemoryCacheOptions): Cache;
|
||||
|
||||
export declare type InMemoryCacheOptions = {
|
||||
/**
|
||||
* If keys and values should be serialized using `JSON.stringify`.
|
||||
*/
|
||||
readonly serializable?: boolean;
|
||||
};
|
||||
|
||||
export { }
|
||||
33
node_modules/@algolia/cache-in-memory/dist/cache-in-memory.esm.js
generated
vendored
33
node_modules/@algolia/cache-in-memory/dist/cache-in-memory.esm.js
generated
vendored
@@ -1,33 +0,0 @@
|
||||
function createInMemoryCache(options = { serializable: true }) {
|
||||
// eslint-disable-next-line functional/no-let
|
||||
let cache = {};
|
||||
return {
|
||||
get(key, defaultValue, events = {
|
||||
miss: () => Promise.resolve(),
|
||||
}) {
|
||||
const keyAsString = JSON.stringify(key);
|
||||
if (keyAsString in cache) {
|
||||
return Promise.resolve(options.serializable ? JSON.parse(cache[keyAsString]) : cache[keyAsString]);
|
||||
}
|
||||
const promise = defaultValue();
|
||||
const miss = (events && events.miss) || (() => Promise.resolve());
|
||||
return promise.then((value) => miss(value)).then(() => promise);
|
||||
},
|
||||
set(key, value) {
|
||||
// eslint-disable-next-line functional/immutable-data
|
||||
cache[JSON.stringify(key)] = options.serializable ? JSON.stringify(value) : value;
|
||||
return Promise.resolve(value);
|
||||
},
|
||||
delete(key) {
|
||||
// eslint-disable-next-line functional/immutable-data
|
||||
delete cache[JSON.stringify(key)];
|
||||
return Promise.resolve();
|
||||
},
|
||||
clear() {
|
||||
cache = {};
|
||||
return Promise.resolve();
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export { createInMemoryCache };
|
||||
Reference in New Issue
Block a user