Refactor App.tsx, brush-command-helpers.ts, editor-store.test.ts, and local-draft-storage.test.ts

This commit is contained in:
2026-03-31 02:13:17 +02:00
parent 22b4c22843
commit 4d95b10e93
4 changed files with 11 additions and 16 deletions

View File

@@ -22,15 +22,15 @@ class MemoryStorage implements KeyValueStorage {
}
class ThrowingStorage implements KeyValueStorage {
getItem(_key: string): string | null {
getItem(): string | null {
throw new Error("blocked read");
}
setItem(_key: string, _value: string): void {
setItem(): void {
throw new Error("blocked write");
}
removeItem(_key: string): void {}
removeItem(): void {}
}
describe("EditorStore", () => {

View File

@@ -35,7 +35,7 @@ class ThrowingStorage implements KeyValueStorage {
} = {}
) {}
getItem(_key: string): string | null {
getItem(): string | null {
if (this.options.onGetItem !== undefined) {
throw this.options.onGetItem;
}
@@ -43,13 +43,13 @@ class ThrowingStorage implements KeyValueStorage {
return null;
}
setItem(_key: string, _value: string): void {
setItem(): void {
if (this.options.onSetItem !== undefined) {
throw this.options.onSetItem;
}
}
removeItem(_key: string): void {
removeItem(): void {
if (this.options.onRemoveItem !== undefined) {
throw this.options.onRemoveItem;
}