initial vitepress site with basic nav

This commit is contained in:
mrflos 2023-05-20 19:37:42 +03:00
parent a7df2e049d
commit 2029f16583
1900 changed files with 1014692 additions and 0 deletions

View file

@ -0,0 +1,37 @@
'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;

View file

@ -0,0 +1,12 @@
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 { }

View file

@ -0,0 +1,33 @@
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 };

2
node_modules/@algolia/cache-in-memory/index.js generated vendored Normal file
View file

@ -0,0 +1,2 @@
// eslint-disable-next-line functional/immutable-data, import/no-commonjs
module.exports = require('./dist/cache-in-memory.cjs.js');

22
node_modules/@algolia/cache-in-memory/package.json generated vendored Normal file
View file

@ -0,0 +1,22 @@
{
"name": "@algolia/cache-in-memory",
"version": "4.17.0",
"private": false,
"description": "Promise-based cache library using memory.",
"repository": {
"type": "git",
"url": "git://github.com/algolia/algoliasearch-client-javascript.git"
},
"license": "MIT",
"sideEffects": false,
"main": "index.js",
"module": "dist/cache-in-memory.esm.js",
"types": "dist/cache-in-memory.d.ts",
"files": [
"index.js",
"dist"
],
"dependencies": {
"@algolia/cache-common": "4.17.0"
}
}