Skip to content

Commit

Permalink
Merge branch 'jul/type-case-fix' into 'master'
Browse files Browse the repository at this point in the history
fix(types): fix "as unknown as" type casts

See merge request TankerHQ/sdk-js!972
  • Loading branch information
JMounier committed Apr 6, 2023
2 parents 3ec17a5 + e6e6500 commit ccfe0f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/Groups/GroupStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,14 @@ export class GroupStore {
selector: {
groupId: { $in: groupIds },
},
}) as unknown as Array<GroupEntry>;
}) as Promise<Array<GroupEntry>>;
}

async _findGroupsByPublicKey(Ids: Array<b64string>): Promise<Array<GroupEntry>> {
return this._ds.find(GROUPS_ENCRYPTION_KEYS_TABLE, {
selector: {
_id: { $in: Ids },
},
}) as unknown as Array<GroupEntry>;
}) as Promise<Array<GroupEntry>>;
}
}
4 changes: 2 additions & 2 deletions packages/core/src/Network/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ export class Client {
_cancelable = <R>(fun: (...args: Array<any>) => Promise<R>) => (...args: Array<any>) => {
// cancelationHandle.promise always rejects. Its returned type doesn't matter
if (this._cancelationHandle.settled) {
return this._cancelationHandle.promise as unknown as Promise<R>;
return this._cancelationHandle.promise as never;
}
return Promise.race([this._cancelationHandle.promise as unknown as Promise<R>, fun(...args)]);
return Promise.race([this._cancelationHandle.promise as never, fun(...args)]);
};

// Simple fetch wrapper with limited concurrency
Expand Down

0 comments on commit ccfe0f1

Please sign in to comment.