{"version":3,"sources":["asynciterable/operators/concatall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,OAAO,sBAAgC,SAAQ,cAAuB;IAG1E,YAAY,MAA6C;QACvD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,MAAoB;QAChD,cAAc,CAAC,MAAM,CAAC,CAAC;QACvB,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,aAAa,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE;YAC7D,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE;gBACrD,MAAM,IAAI,CAAC;aACZ;SACF;IACH,CAAC;CACF;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS;IACvB,OAAO,SAAS,yBAAyB,CACvC,MAAuC;QAEvC,OAAO,IAAI,sBAAsB,CAAI,MAAM,CAAC,CAAC;IAC/C,CAAC,CAAC;AACJ,CAAC","file":"concatall.js","sourcesContent":["import { AsyncIterableX } from '../asynciterablex';\nimport { OperatorAsyncFunction } from '../../interfaces';\nimport { wrapWithAbort } from './withabort';\nimport { throwIfAborted } from '../../aborterror';\n\nexport class ConcatAllAsyncIterable<TSource> extends AsyncIterableX<TSource> {\n  private _source: AsyncIterable<AsyncIterable<TSource>>;\n\n  constructor(source: AsyncIterable<AsyncIterable<TSource>>) {\n    super();\n    this._source = source;\n  }\n\n  async *[Symbol.asyncIterator](signal?: AbortSignal) {\n    throwIfAborted(signal);\n    for await (const outer of wrapWithAbort(this._source, signal)) {\n      for await (const item of wrapWithAbort(outer, signal)) {\n        yield item;\n      }\n    }\n  }\n}\n\n/**\n * Concatenates all inner async-iterable sequences, as long as the previous\n * async-iterable sequence terminated successfully.\n *\n * @export\n * @template T The type of elements in the source sequence.\n * @returns {OperatorAsyncFunction<AsyncIterable<T>, T>} An operator which concatenates all inner async-iterable sources.\n */\nexport function concatAll<T>(): OperatorAsyncFunction<AsyncIterable<T>, T> {\n  return function concatAllOperatorFunction(\n    source: AsyncIterable<AsyncIterable<T>>\n  ): AsyncIterableX<T> {\n    return new ConcatAllAsyncIterable<T>(source);\n  };\n}\n"]}