@occultist/occultist 0.0.4 → 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.
@@ -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>;
@@ -41,6 +41,9 @@ export class FileCacheMeta {
41
41
  export class FileSystemCacheStorage {
42
42
  #directory;
43
43
  #hashes = new Map();
44
+ constructor(directory) {
45
+ this.#directory = directory;
46
+ }
44
47
  hash(key) {
45
48
  let hash = this.#hashes.get(key);
46
49
  if (hash != null)
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/package.json CHANGED
@@ -34,7 +34,7 @@
34
34
  "jsonld": "^9.0.0",
35
35
  "typescript": "^5.9.3"
36
36
  },
37
- "version": "0.0.4",
37
+ "version": "0.0.5",
38
38
  "scripts": {
39
39
  "build": "tsc"
40
40
  }