Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 11c8b69

Browse files
committedJan 27, 2025·
Clean up some unused imports and unnecessary vars
1 parent 0a5b1f2 commit 11c8b69

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed
 

‎packages/file-storage/src/lib/local-file-storage.ts

+3-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { openFile, writeFile } from '@mjackson/lazy-file/fs';
55

66
import {
77
type FileStorage,
8-
type FileKey,
98
type FileMetadata,
109
type ListOptions,
1110
type ListResult,
@@ -164,15 +163,12 @@ export class LocalFileStorage implements FileStorage {
164163

165164
async #getPaths(key: string): Promise<{ directory: string; filePath: string; metaPath: string }> {
166165
let hash = await computeHash(key);
167-
let shardDir = hash.slice(0, 2);
168-
let directory = path.join(this.#dirname, shardDir);
169-
let filename = `${hash}.dat`;
170-
let metaname = `${hash}.meta.json`;
166+
let directory = path.join(this.#dirname, hash.slice(0, 2));
171167

172168
return {
173169
directory,
174-
filePath: path.join(directory, filename),
175-
metaPath: path.join(directory, metaname),
170+
filePath: path.join(directory, `${hash}.dat`),
171+
metaPath: path.join(directory, `${hash}.meta.json`),
176172
};
177173
}
178174
}

‎packages/file-storage/src/lib/memory-file-storage.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
import {
2-
type FileKey,
3-
type FileMetadata,
4-
type FileStorage,
5-
type ListOptions,
6-
type ListResult,
7-
} from './file-storage.ts';
1+
import { type FileStorage, type ListOptions, type ListResult } from './file-storage.ts';
82

93
/**
104
* A simple, in-memory implementation of the `FileStorage` interface.

0 commit comments

Comments
 (0)
Please sign in to comment.