mirror of
https://github.com/misskey-dev/misskey.git
synced 2025-01-10 08:53:02 +01:00
型アサーションの追加
This commit is contained in:
parent
0be833b4f5
commit
68234085db
1 changed files with 1 additions and 1 deletions
|
@ -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: {
|
||||
|
|
Loading…
Reference in a new issue