We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 705e4df commit 778be7dCopy full SHA for 778be7d
1 file changed
src/stores/unstorage.ts
@@ -73,9 +73,13 @@ export class UnstorageStore<
73
async get(key: string): Promise<ClientRateLimitInfo | undefined> {
74
const result = await this.storage
75
.get(this.prefixKey(key))
76
- .then((value) =>
77
- value ? (JSON.parse(String(value)) as ClientRateLimitInfo) : undefined,
78
- );
+ .then((value) => {
+ if (typeof value === 'object') {
+ return value as ClientRateLimitInfo;
79
+ }
80
+
81
+ return value ? JSON.parse(String(value)) as ClientRateLimitInfo : undefined;
82
+ });
83
84
return result;
85
}
0 commit comments