@occultist/occultist 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cache/file.d.ts +1 -0
- package/dist/cache/file.js +3 -0
- package/dist/mod.d.ts +1 -0
- package/dist/mod.js +1 -0
- package/lib/cache/file.ts +5 -0
- package/lib/mod.ts +1 -0
- package/package.json +1 -1
package/dist/cache/file.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare class FileCacheMeta implements CacheMeta {
|
|
|
7
7
|
}
|
|
8
8
|
export declare class FileSystemCacheStorage implements CacheStorage {
|
|
9
9
|
#private;
|
|
10
|
+
constructor(directory: string);
|
|
10
11
|
hash(key: string): string;
|
|
11
12
|
get(key: string): Promise<Blob>;
|
|
12
13
|
set(key: string, value: Blob): Promise<void>;
|
package/dist/cache/file.js
CHANGED
package/dist/mod.d.ts
CHANGED
package/dist/mod.js
CHANGED
package/lib/cache/file.ts
CHANGED
|
@@ -2,6 +2,7 @@ import {createHash} from 'node:crypto';
|
|
|
2
2
|
import type {CacheDetails, CacheHitHandle, CacheMeta, CacheStorage, CacheMissHandle} from './types.js';
|
|
3
3
|
import {FileHandle, open, readFile, writeFile, rm} from 'node:fs/promises';
|
|
4
4
|
import {join} from 'node:path';
|
|
5
|
+
import {dir} from 'node:console';
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
|
|
@@ -57,6 +58,10 @@ export class FileSystemCacheStorage implements CacheStorage {
|
|
|
57
58
|
|
|
58
59
|
#directory: string;
|
|
59
60
|
#hashes: Map<string, string> = new Map();
|
|
61
|
+
|
|
62
|
+
constructor(directory: string) {
|
|
63
|
+
this.#directory = directory;
|
|
64
|
+
}
|
|
60
65
|
|
|
61
66
|
hash(key: string): string {
|
|
62
67
|
let hash = this.#hashes.get(key);
|
package/lib/mod.ts
CHANGED