@sourceregistry/sveltekit-enhance 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -42,7 +42,7 @@ export type RequestRateLimitOptions<RuleId extends string> = {
|
|
|
42
42
|
store?: RateLimitStore;
|
|
43
43
|
logger?: Logger;
|
|
44
44
|
};
|
|
45
|
-
export declare const RequestRateLimit: {
|
|
46
|
-
inspect:
|
|
45
|
+
export declare const RequestRateLimit: <RuleId extends string>(options: RequestRateLimitOptions<RuleId>) => {
|
|
46
|
+
inspect: (input: EnhanceInput<"handle">) => Promise<void>;
|
|
47
47
|
};
|
|
48
48
|
export {};
|
|
@@ -66,8 +66,8 @@ const decorateRateLimitHeaders = (response, input) => {
|
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
|
-
export const RequestRateLimit = ({
|
|
70
|
-
inspect:
|
|
69
|
+
export const RequestRateLimit = (options) => ({
|
|
70
|
+
inspect: async (input) => {
|
|
71
71
|
if (options.enabled === false)
|
|
72
72
|
return;
|
|
73
73
|
const method = input.request.method.toUpperCase();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sourceregistry/sveltekit-enhance",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "Composable enhance and form utilities for SvelteKit actions, loads, methods, and hooks.",
|
|
5
5
|
"author": "A.P.A. Slaa (a.p.a.slaa@projectsource.nl)",
|
|
6
6
|
"scripts": {
|