From ace02e2b9bc64563df4976574a5f6fcb1fdd89a5 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Fri, 22 Nov 2024 18:59:17 +0200 Subject: [PATCH] chore: try to fix CI --- deno/rest/v10/mod.ts | 8 ++++---- deno/rest/v9/mod.ts | 8 ++++---- rest/v10/index.ts | 8 ++++---- rest/v9/index.ts | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/deno/rest/v10/mod.ts b/deno/rest/v10/mod.ts index 61de424f..fab275b9 100644 --- a/deno/rest/v10/mod.ts +++ b/deno/rest/v10/mod.ts @@ -1054,8 +1054,8 @@ export const Routes = { }; for (const [key, fn] of Object.entries(Routes)) { - Routes[key] = (...args: string[]) => { - const escaped = args.map((arg) => encodeURIComponent(arg)); + Routes[key as keyof typeof Routes] = (...args: (boolean | number | string | undefined)[]) => { + const escaped = args.map((arg) => arg && encodeURIComponent(arg)); // eslint-disable-next-line no-useless-call return fn.call(null, ...escaped); }; @@ -1362,8 +1362,8 @@ export const CDNRoutes = { }; for (const [key, fn] of Object.entries(CDNRoutes)) { - CDNRoutes[key] = (...args: string[]) => { - const escaped = args.map((arg) => encodeURIComponent(arg)); + CDNRoutes[key as keyof typeof CDNRoutes] = (...args: (number | string | undefined)[]) => { + const escaped = args.map((arg) => arg && encodeURIComponent(arg)); // eslint-disable-next-line no-useless-call return fn.call(null, ...escaped); }; diff --git a/deno/rest/v9/mod.ts b/deno/rest/v9/mod.ts index 419307af..95d4e63c 100644 --- a/deno/rest/v9/mod.ts +++ b/deno/rest/v9/mod.ts @@ -1063,8 +1063,8 @@ export const Routes = { }; for (const [key, fn] of Object.entries(Routes)) { - Routes[key] = (...args: string[]) => { - const escaped = args.map((arg) => encodeURIComponent(arg)); + Routes[key as keyof typeof Routes] = (...args: (boolean | number | string | undefined)[]) => { + const escaped = args.map((arg) => arg && encodeURIComponent(arg)); // eslint-disable-next-line no-useless-call return fn.call(null, ...escaped); }; @@ -1371,8 +1371,8 @@ export const CDNRoutes = { }; for (const [key, fn] of Object.entries(CDNRoutes)) { - CDNRoutes[key] = (...args: string[]) => { - const escaped = args.map((arg) => encodeURIComponent(arg)); + CDNRoutes[key as keyof typeof CDNRoutes] = (...args: (number | string | undefined)[]) => { + const escaped = args.map((arg) => arg && encodeURIComponent(arg)); // eslint-disable-next-line no-useless-call return fn.call(null, ...escaped); }; diff --git a/rest/v10/index.ts b/rest/v10/index.ts index 06ce6328..5c7ce367 100644 --- a/rest/v10/index.ts +++ b/rest/v10/index.ts @@ -1054,8 +1054,8 @@ export const Routes = { }; for (const [key, fn] of Object.entries(Routes)) { - Routes[key] = (...args: string[]) => { - const escaped = args.map((arg) => encodeURIComponent(arg)); + Routes[key as keyof typeof Routes] = (...args: (boolean | number | string | undefined)[]) => { + const escaped = args.map((arg) => arg && encodeURIComponent(arg)); // eslint-disable-next-line no-useless-call return fn.call(null, ...escaped); }; @@ -1362,8 +1362,8 @@ export const CDNRoutes = { }; for (const [key, fn] of Object.entries(CDNRoutes)) { - CDNRoutes[key] = (...args: string[]) => { - const escaped = args.map((arg) => encodeURIComponent(arg)); + CDNRoutes[key as keyof typeof CDNRoutes] = (...args: (number | string | undefined)[]) => { + const escaped = args.map((arg) => arg && encodeURIComponent(arg)); // eslint-disable-next-line no-useless-call return fn.call(null, ...escaped); }; diff --git a/rest/v9/index.ts b/rest/v9/index.ts index b5376cf2..93a0bc3e 100644 --- a/rest/v9/index.ts +++ b/rest/v9/index.ts @@ -1063,8 +1063,8 @@ export const Routes = { }; for (const [key, fn] of Object.entries(Routes)) { - Routes[key] = (...args: string[]) => { - const escaped = args.map((arg) => encodeURIComponent(arg)); + Routes[key as keyof typeof Routes] = (...args: (boolean | number | string | undefined)[]) => { + const escaped = args.map((arg) => arg && encodeURIComponent(arg)); // eslint-disable-next-line no-useless-call return fn.call(null, ...escaped); }; @@ -1371,8 +1371,8 @@ export const CDNRoutes = { }; for (const [key, fn] of Object.entries(CDNRoutes)) { - CDNRoutes[key] = (...args: string[]) => { - const escaped = args.map((arg) => encodeURIComponent(arg)); + CDNRoutes[key as keyof typeof CDNRoutes] = (...args: (number | string | undefined)[]) => { + const escaped = args.map((arg) => arg && encodeURIComponent(arg)); // eslint-disable-next-line no-useless-call return fn.call(null, ...escaped); };