Skip to content

Commit

Permalink
fix: input can be a AsyncIterableIterator
Browse files Browse the repository at this point in the history
  • Loading branch information
aryanjassal committed Dec 6, 2024
1 parent 2a408fc commit 9ff1390
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/client/handlers/VaultsSecretsRemove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class VaultsSecretsRemove extends DuplexHandler<
ClientRPCResponseResult<SuccessOrErrorMessage>
> {
public handle = async function* (
input: AsyncIterable<
input: AsyncIterableIterator<
ClientRPCRequestParams<
SecretsRemoveHeaderMessage | SecretIdentifierMessageTagged
>
Expand All @@ -36,9 +36,8 @@ class VaultsSecretsRemove extends DuplexHandler<
this.container;
// Extracts the header message from the iterator
const headerMessage = await (async () => {
const iterator = input[Symbol.asyncIterator]();
const header: SecretsRemoveHeaderMessage | SecretIdentifierMessageTagged =
(await iterator.next()).value;
(await input.next()).value;
if (header == null || header.type !== 'VaultNamesHeaderMessage') {
throw new clientErrors.ErrorClientInvalidHeader();
}
Expand Down

0 comments on commit 9ff1390

Please sign in to comment.