(options?: {prefix?: string})
| 807 | } |
| 808 | |
| 809 | async list<T>(options?: {prefix?: string}): Promise<Map<string, T>> { |
| 810 | const result = new Map<string, T>(); |
| 811 | const prefix = options?.prefix ?? ''; |
| 812 | for (const [key, value] of this.data.entries()) { |
| 813 | if (key.startsWith(prefix)) { |
| 814 | result.set(key, value); |
| 815 | } |
| 816 | } |
| 817 | return result; |
| 818 | } |
| 819 | |
| 820 | async delete(key: string): Promise<boolean> { |
| 821 | return this.data.delete(key); |