UNPKG

2.42 kBSource Map (JSON)View Raw
1{"version":3,"sources":["asynciterable/onerrorresumenext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,OAAO,8BAAwC,SAAQ,cAAuB;IAGlF,YAAY,MAAwC;QAClD,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,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,OAAO,EAAE;YAC/B,MAAM,EAAE,GAAG,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;YAC/D,OAAO,CAAC,EAAE;gBACR,IAAI,IAAI,CAAC;gBACT,IAAI;oBACF,IAAI,GAAG,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC;iBACxB;gBAAC,OAAO,CAAC,EAAE;oBACV,MAAM;iBACP;gBAED,IAAI,IAAI,CAAC,IAAI,EAAE;oBACb,MAAM;iBACP;gBACD,MAAM,IAAI,CAAC,KAAK,CAAC;aAClB;SACF;IACH,CAAC;CACF;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAI,GAAG,IAAwB;IAC9D,OAAO,IAAI,8BAA8B,CAAI,IAAI,CAAC,CAAC;AACrD,CAAC","file":"onerrorresumenext.js","sourcesContent":["import { AsyncIterableX } from './asynciterablex';\nimport { wrapWithAbort } from './operators/withabort';\nimport { throwIfAborted } from '../aborterror';\n\nexport class OnErrorResumeNextAsyncIterable<TSource> extends AsyncIterableX<TSource> {\n private _source: Iterable<AsyncIterable<TSource>>;\n\n constructor(source: Iterable<AsyncIterable<TSource>>) {\n super();\n this._source = source;\n }\n\n async *[Symbol.asyncIterator](signal?: AbortSignal) {\n throwIfAborted(signal);\n for (const item of this._source) {\n const it = wrapWithAbort(item, signal)[Symbol.asyncIterator]();\n while (1) {\n let next;\n try {\n next = await it.next();\n } catch (e) {\n break;\n }\n\n if (next.done) {\n break;\n }\n yield next.value;\n }\n }\n }\n}\n\n/**\n * Concatenates all of the specified async-iterable sequences, even if the previous async-iterable sequence terminated exceptionally.\n *\n * @export\n * @template T The type of the elements in the source sequences.\n * @param {...AsyncIterable<T>[]} args Async-iterable sequences to concatenate.\n * @returns {AsyncIterableX<T>} An async-iterable sequence that concatenates the source sequences, even if a sequence terminates exceptionally.\n */\nexport function onErrorResumeNext<T>(...args: AsyncIterable<T>[]): AsyncIterableX<T> {\n return new OnErrorResumeNextAsyncIterable<T>(args);\n}\n"]}
\No newline at end of file