From 81324a5fc6a51bbdc6ca7ed9d11e52a459cc2c86 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 21 Jun 2022 07:49:03 +0300 Subject: [PATCH] added AsyncGenerator.prototype.flat(..)... Signed-off-by: Alex A. Naanou --- generator.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/generator.js b/generator.js index 0226b98..695ab6f 100644 --- a/generator.js +++ b/generator.js @@ -510,6 +510,13 @@ object.Mixin('AsyncGeneratorProtoMixin', 'soft', { return [] }) return state }, + flat: async function*(){ + for await(var e of this){ + if(e instanceof Array){ + yield* e + } else { + yield e }}}, + concat: async function*(other){ yield* this yield* other },