mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-06-16 17:49:09 +00:00
chore: update codestyle due to prettier/rule updates
This commit is contained in:
parent
f632bfa6e5
commit
10e095656f
16 changed files with 298 additions and 292 deletions
|
@ -1,15 +1,13 @@
|
|||
import { WrappedKVNamespace } from './kv';
|
||||
|
||||
export const useRateLimiter = (
|
||||
kv: WrappedKVNamespace,
|
||||
key: string,
|
||||
timeoutSeconds: number
|
||||
) => async (): Promise<boolean> => {
|
||||
const value = await kv.get<boolean>(key);
|
||||
if (value) {
|
||||
return true;
|
||||
}
|
||||
export const useRateLimiter =
|
||||
(kv: WrappedKVNamespace, key: string, timeoutSeconds: number) =>
|
||||
async (): Promise<boolean> => {
|
||||
const value = await kv.get<boolean>(key);
|
||||
if (value) {
|
||||
return true;
|
||||
}
|
||||
|
||||
await kv.put(key, true, timeoutSeconds);
|
||||
return false;
|
||||
};
|
||||
await kv.put(key, true, timeoutSeconds);
|
||||
return false;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue