mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-11-04 08:10:28 +09:00
상위 디렉터리 및 카테고리의 소유권을 검증하지 않던 문제 등 버그 수정 및 Vitest 기반 테스트 추가
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
67989f4741
commit
ed732be999
31 files changed
+2057
-42
No files matched your search
@@ -1,3 +1,25 @@
|
||||
import type { FileMetadata } from "./types";
|
||||
|
||||
export const fileMetadataStore = new Map<number, FileMetadata>();
|
||||
const MAX_FILE_METADATA_ENTRIES = 32;
|
||||
|
||||
const fileMetadata = new Map<number, FileMetadata>();
|
||||
|
||||
export const fileMetadataStore = {
|
||||
get(fileId: number) {
|
||||
const metadata = fileMetadata.get(fileId);
|
||||
if (metadata) {
|
||||
// Move to the end to keep the most recently used entries
|
||||
fileMetadata.delete(fileId);
|
||||
fileMetadata.set(fileId, metadata);
|
||||
}
|
||||
return metadata;
|
||||
},
|
||||
set(fileId: number, metadata: FileMetadata) {
|
||||
fileMetadata.delete(fileId);
|
||||
fileMetadata.set(fileId, metadata);
|
||||
|
||||
while (fileMetadata.size > MAX_FILE_METADATA_ENTRIES) {
|
||||
fileMetadata.delete(fileMetadata.keys().next().value!);
|
||||
}
|
||||
},
|
||||
};
|
||||
Reference in new issue
Block a user