mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-17 11:32:27 +00:00
21 lines
578 B
TypeScript
21 lines
578 B
TypeScript
import type { ICache } from '../types/Cache.js';
|
|
import { Platform } from './Utils.js';
|
|
|
|
export default class UniversalCache implements ICache {
|
|
#cache: ICache;
|
|
constructor(persistent: boolean, persistent_directory?: string) {
|
|
this.#cache = new Platform.shim.Cache(persistent, persistent_directory);
|
|
}
|
|
get cache_dir() {
|
|
return this.#cache.cache_dir;
|
|
}
|
|
get(key: string) {
|
|
return this.#cache.get(key);
|
|
}
|
|
set(key: string, value: ArrayBuffer) {
|
|
return this.#cache.set(key, value);
|
|
}
|
|
remove(key: string) {
|
|
return this.#cache.remove(key);
|
|
}
|
|
} |