Skip to content

Commit 588140c

Browse files
committed
chore: test for this in tsd land not ts land
1 parent 799044d commit 588140c

File tree

7 files changed

+19
-9
lines changed

7 files changed

+19
-9
lines changed

deno/rest/v10/mod.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ export const Routes = {
988988
applicationEmoji(applicationId: Snowflake, emojiId: Snowflake) {
989989
return `/applications/${applicationId}/emojis/${emojiId}` as const;
990990
},
991-
} satisfies Record<string, (...args: unknown[]) => `/${string}`>;
991+
};
992992

993993
export const StickerPackApplicationId = '710982414301790216';
994994

@@ -1277,7 +1277,7 @@ export const CDNRoutes = {
12771277
) {
12781278
return `/guilds/${guildId}/users/${userId}/banners/${guildMemberBanner}.${format}` as const;
12791279
},
1280-
} satisfies Record<string, (...args: unknown[]) => `/${string}`>;
1280+
};
12811281

12821282
export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5;
12831283

deno/rest/v9/mod.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ export const Routes = {
997997
applicationEmoji(applicationId: Snowflake, emojiId: Snowflake) {
998998
return `/applications/${applicationId}/emojis/${emojiId}` as const;
999999
},
1000-
} satisfies Record<string, (...args: unknown[]) => `/${string}`>;
1000+
};
10011001

10021002
export const StickerPackApplicationId = '710982414301790216';
10031003

@@ -1286,7 +1286,7 @@ export const CDNRoutes = {
12861286
) {
12871287
return `/guilds/${guildId}/users/${userId}/banners/${guildMemberBanner}.${format}` as const;
12881288
},
1289-
} satisfies Record<string, (...args: unknown[]) => `/${string}`>;
1289+
};
12901290

12911291
export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5;
12921292

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
"prepublishOnly": "run-s clean test:lint build:node",
114114
"test:lint": "prettier --check . && eslint --ext mjs,ts \"{gateway,payloads,rest,rpc,voice,utils}/**/*.ts\" \"{globals,v*}.ts\" \"scripts/**/*.mjs\"",
115115
"pretest:types": "tsc",
116-
"test:types": "tsd -t ./v10.d.ts",
116+
"test:types": "tsd -t ./v10.d.ts && tsd -t ./v9.d.ts",
117117
"posttest:types": "npm run clean:node"
118118
},
119119
"keywords": [

rest/v10/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ export const Routes = {
988988
applicationEmoji(applicationId: Snowflake, emojiId: Snowflake) {
989989
return `/applications/${applicationId}/emojis/${emojiId}` as const;
990990
},
991-
} satisfies Record<string, (...args: unknown[]) => `/${string}`>;
991+
};
992992

993993
export const StickerPackApplicationId = '710982414301790216';
994994

@@ -1277,7 +1277,7 @@ export const CDNRoutes = {
12771277
) {
12781278
return `/guilds/${guildId}/users/${userId}/banners/${guildMemberBanner}.${format}` as const;
12791279
},
1280-
} satisfies Record<string, (...args: unknown[]) => `/${string}`>;
1280+
};
12811281

12821282
export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5;
12831283

rest/v9/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ export const Routes = {
997997
applicationEmoji(applicationId: Snowflake, emojiId: Snowflake) {
998998
return `/applications/${applicationId}/emojis/${emojiId}` as const;
999999
},
1000-
} satisfies Record<string, (...args: unknown[]) => `/${string}`>;
1000+
};
10011001

10021002
export const StickerPackApplicationId = '710982414301790216';
10031003

@@ -1286,7 +1286,7 @@ export const CDNRoutes = {
12861286
) {
12871287
return `/guilds/${guildId}/users/${userId}/banners/${guildMemberBanner}.${format}` as const;
12881288
},
1289-
} satisfies Record<string, (...args: unknown[]) => `/${string}`>;
1289+
};
12901290

12911291
export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5;
12921292

tests/v10/routes.test-d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { expectAssignable } from 'tsd';
2+
import { CDNRoutes, Routes } from '../../rest/v10/index';
3+
4+
expectAssignable<Record<string, (...args: any[]) => `/${string}`>>(Routes);
5+
expectAssignable<Record<string, (...args: any[]) => `/${string}`>>(CDNRoutes);

tests/v9/routes.test-d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { expectAssignable } from 'tsd';
2+
import { CDNRoutes, Routes } from '../../rest/v9/index';
3+
4+
expectAssignable<Record<string, (...args: any[]) => `/${string}`>>(Routes);
5+
expectAssignable<Record<string, (...args: any[]) => `/${string}`>>(CDNRoutes);

0 commit comments

Comments
 (0)