From bd53cb16fd1a7a2aae0bee30d8c2923422fd1980 Mon Sep 17 00:00:00 2001 From: morrigan Date: Mon, 2 Dec 2019 12:53:27 +0100 Subject: [PATCH 1/2] Fix eslint --- src/crypto.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crypto.ts b/src/crypto.ts index fb8308a..fd0adda 100644 --- a/src/crypto.ts +++ b/src/crypto.ts @@ -7,7 +7,7 @@ interface ReturnEncryptionWrapper { } // Returns generator that encrypts payload from the user - export function encryptStream(handshake: Handshake): ReturnEncryptionWrapper { +export function encryptStream(handshake: Handshake): ReturnEncryptionWrapper { return async function * (source) { for await (const chunk of source) { const chunkBuffer = Buffer.from(chunk); From d8ad3fc1cd7e6e2d14382e176240f8d479375c0e Mon Sep 17 00:00:00 2001 From: morrigan Date: Mon, 2 Dec 2019 13:20:31 +0100 Subject: [PATCH 2/2] Update stream type --- src/crypto.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crypto.ts b/src/crypto.ts index fd0adda..86ee648 100644 --- a/src/crypto.ts +++ b/src/crypto.ts @@ -3,7 +3,7 @@ import { Handshake } from "./handshake"; import { Buffer } from "buffer"; interface ReturnEncryptionWrapper { - (source: Iterable): any; + (source: Iterable): AsyncIterableIterator; } // Returns generator that encrypts payload from the user