型アサーションの追加

This commit is contained in:
Kisaragi Marine 2024-07-09 19:28:05 +09:00
parent 0be833b4f5
commit 68234085db
No known key found for this signature in database
GPG Key ID: C6631564CD2110E4
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ export const successfulApiCall = async <E extends keyof misskey.Endpoints, P ext
const status = assertion.status ?? (res.body == null ? 204 : 200);
assert.strictEqual(res.status, status, inspect(res.body, { depth: 5, colors: true }));
assert.ok(res.body);
return res.body;
return res.body as misskey.api.SwitchCaseResponseType<E, P>;
};
export const failedApiCall = async <E extends keyof misskey.Endpoints, P extends misskey.Endpoints[E]['req']>(request: ApiRequest<E, P>, assertion: {