iter-fest 0.1.1-main.540eb2b → 0.1.1-main.57b2094
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +230 -26
- package/dist/chunk-2DE3J4J7.mjs +35 -0
- package/dist/chunk-2DE3J4J7.mjs.map +1 -0
- package/dist/chunk-3S6LCGE6.mjs +10 -0
- package/dist/chunk-3S6LCGE6.mjs.map +1 -0
- package/dist/{chunk-UIEKIMLW.mjs → chunk-AN54W42O.mjs} +8 -5
- package/dist/chunk-AN54W42O.mjs.map +1 -0
- package/dist/chunk-ANRVAYLW.mjs +35 -0
- package/dist/chunk-ANRVAYLW.mjs.map +1 -0
- package/dist/chunk-BSAPKNNZ.mjs +16 -0
- package/dist/chunk-BSAPKNNZ.mjs.map +1 -0
- package/dist/chunk-BWMXKULC.mjs +46 -0
- package/dist/chunk-BWMXKULC.mjs.map +1 -0
- package/dist/chunk-CNCNQPK3.mjs +16 -0
- package/dist/chunk-CNCNQPK3.mjs.map +1 -0
- package/dist/chunk-EIIP7YWB.mjs +27 -0
- package/dist/chunk-EIIP7YWB.mjs.map +1 -0
- package/dist/{chunk-KONB7TV6.mjs → chunk-EQZQP6GW.mjs} +8 -5
- package/dist/chunk-EQZQP6GW.mjs.map +1 -0
- package/dist/chunk-EUVK4YM7.mjs +25 -0
- package/dist/chunk-EUVK4YM7.mjs.map +1 -0
- package/dist/chunk-FBST4AUL.mjs +10 -0
- package/dist/chunk-FBST4AUL.mjs.map +1 -0
- package/dist/chunk-FEEBFWAI.mjs +24 -0
- package/dist/chunk-FEEBFWAI.mjs.map +1 -0
- package/dist/chunk-FEOLYD5R.mjs +31 -0
- package/dist/chunk-FEOLYD5R.mjs.map +1 -0
- package/dist/chunk-FMIHIL6A.mjs +10 -0
- package/dist/chunk-FMIHIL6A.mjs.map +1 -0
- package/dist/{chunk-27NJVC7K.mjs → chunk-H27CTQGV.mjs} +8 -5
- package/dist/chunk-H27CTQGV.mjs.map +1 -0
- package/dist/{chunk-MDBK7ND5.mjs → chunk-H5ARVU55.mjs} +8 -5
- package/dist/chunk-H5ARVU55.mjs.map +1 -0
- package/dist/{chunk-WKIRSZXX.mjs → chunk-IZXDQ25M.mjs} +8 -5
- package/dist/chunk-IZXDQ25M.mjs.map +1 -0
- package/dist/chunk-KYMTQJIJ.mjs +10 -0
- package/dist/chunk-KYMTQJIJ.mjs.map +1 -0
- package/dist/chunk-LIMQXDFK.mjs +10 -0
- package/dist/chunk-LIMQXDFK.mjs.map +1 -0
- package/dist/chunk-MO7HMLOZ.mjs +24 -0
- package/dist/chunk-MO7HMLOZ.mjs.map +1 -0
- package/dist/chunk-MYSNSDM7.mjs +13 -0
- package/dist/chunk-MYSNSDM7.mjs.map +1 -0
- package/dist/chunk-NZRXO7EY.mjs +24 -0
- package/dist/chunk-NZRXO7EY.mjs.map +1 -0
- package/dist/chunk-OCK7PKGO.mjs +23 -0
- package/dist/chunk-OCK7PKGO.mjs.map +1 -0
- package/dist/chunk-OJMT4K3R.mjs +8 -0
- package/dist/chunk-OJMT4K3R.mjs.map +1 -0
- package/dist/chunk-OWUGLCQB.mjs +10 -0
- package/dist/chunk-OWUGLCQB.mjs.map +1 -0
- package/dist/chunk-P4OSZLEH.mjs +15 -0
- package/dist/chunk-P4OSZLEH.mjs.map +1 -0
- package/dist/chunk-PGJSIDLV.mjs +25 -0
- package/dist/chunk-PGJSIDLV.mjs.map +1 -0
- package/dist/chunk-QX6EMOSQ.mjs +10 -0
- package/dist/chunk-QX6EMOSQ.mjs.map +1 -0
- package/dist/chunk-R6SXIXMH.mjs +10 -0
- package/dist/chunk-R6SXIXMH.mjs.map +1 -0
- package/dist/chunk-TDHR35S7.mjs +10 -0
- package/dist/chunk-TDHR35S7.mjs.map +1 -0
- package/dist/chunk-VCKLUCOT.mjs +10 -0
- package/dist/chunk-VCKLUCOT.mjs.map +1 -0
- package/dist/chunk-VLF6DI2U.mjs +30 -0
- package/dist/chunk-VLF6DI2U.mjs.map +1 -0
- package/dist/chunk-XQDGXAAF.mjs +10 -0
- package/dist/chunk-XQDGXAAF.mjs.map +1 -0
- package/dist/chunk-YJSIVBF7.mjs +22 -0
- package/dist/chunk-YJSIVBF7.mjs.map +1 -0
- package/dist/chunk-YLERARWI.mjs +10 -0
- package/dist/chunk-YLERARWI.mjs.map +1 -0
- package/dist/iter-fest.asyncGeneratorWithLastValue.d.mts +6 -0
- package/dist/iter-fest.asyncGeneratorWithLastValue.d.ts +6 -0
- package/dist/iter-fest.asyncGeneratorWithLastValue.js +59 -0
- package/dist/iter-fest.asyncGeneratorWithLastValue.js.map +1 -0
- package/dist/iter-fest.asyncGeneratorWithLastValue.mjs +7 -0
- package/dist/iter-fest.asyncIteratorToAsyncIterable.d.mts +3 -0
- package/dist/iter-fest.asyncIteratorToAsyncIterable.d.ts +3 -0
- package/dist/{iter-fest.iterableConcat.js → iter-fest.asyncIteratorToAsyncIterable.js} +15 -16
- package/dist/iter-fest.asyncIteratorToAsyncIterable.js.map +1 -0
- package/dist/iter-fest.asyncIteratorToAsyncIterable.mjs +7 -0
- package/dist/iter-fest.d.mts +36 -20
- package/dist/iter-fest.d.ts +36 -20
- package/dist/iter-fest.generatorWithLastValue.d.mts +6 -0
- package/dist/iter-fest.generatorWithLastValue.d.ts +6 -0
- package/dist/iter-fest.generatorWithLastValue.js +59 -0
- package/dist/iter-fest.generatorWithLastValue.js.map +1 -0
- package/dist/iter-fest.generatorWithLastValue.mjs +7 -0
- package/dist/iter-fest.iterableWritableStream.d.mts +7 -0
- package/dist/iter-fest.iterableWritableStream.d.ts +7 -0
- package/dist/iter-fest.iterableWritableStream.js +82 -0
- package/dist/iter-fest.iterableWritableStream.js.map +1 -0
- package/dist/iter-fest.iterableWritableStream.mjs +7 -0
- package/dist/{iter-fest.iterableAt.d.ts → iter-fest.iteratorAt.d.mts} +2 -2
- package/dist/{iter-fest.iterableAt.d.mts → iter-fest.iteratorAt.d.ts} +2 -2
- package/dist/{iter-fest.iterableAt.js → iter-fest.iteratorAt.js} +21 -10
- package/dist/iter-fest.iteratorAt.js.map +1 -0
- package/dist/iter-fest.iteratorAt.mjs +9 -0
- package/dist/iter-fest.iteratorConcat.d.mts +16 -0
- package/dist/iter-fest.iteratorConcat.d.ts +16 -0
- package/dist/iter-fest.iteratorConcat.js +56 -0
- package/dist/iter-fest.iteratorConcat.js.map +1 -0
- package/dist/iter-fest.iteratorConcat.mjs +8 -0
- package/dist/iter-fest.iteratorDrop.d.mts +12 -0
- package/dist/iter-fest.iteratorDrop.d.ts +12 -0
- package/dist/iter-fest.iteratorDrop.js +44 -0
- package/dist/iter-fest.iteratorDrop.js.map +1 -0
- package/dist/iter-fest.iteratorDrop.mjs +7 -0
- package/dist/iter-fest.iteratorEntries.d.mts +6 -0
- package/dist/iter-fest.iteratorEntries.d.ts +6 -0
- package/dist/{iter-fest.iterableEntries.js → iter-fest.iteratorEntries.js} +22 -9
- package/dist/iter-fest.iteratorEntries.js.map +1 -0
- package/dist/iter-fest.iteratorEntries.mjs +8 -0
- package/dist/iter-fest.iteratorEvery.d.mts +25 -0
- package/dist/iter-fest.iteratorEvery.d.ts +25 -0
- package/dist/iter-fest.iteratorEvery.js +44 -0
- package/dist/iter-fest.iteratorEvery.js.map +1 -0
- package/dist/iter-fest.iteratorEvery.mjs +7 -0
- package/dist/iter-fest.iteratorFilter.d.mts +18 -0
- package/dist/iter-fest.iteratorFilter.d.ts +18 -0
- package/dist/iter-fest.iteratorFilter.js +44 -0
- package/dist/iter-fest.iteratorFilter.js.map +1 -0
- package/dist/iter-fest.iteratorFilter.mjs +7 -0
- package/dist/iter-fest.iteratorFind.d.mts +14 -0
- package/dist/iter-fest.iteratorFind.d.ts +14 -0
- package/dist/iter-fest.iteratorFind.js +44 -0
- package/dist/iter-fest.iteratorFind.js.map +1 -0
- package/dist/iter-fest.iteratorFind.mjs +7 -0
- package/dist/{iter-fest.iterableFindIndex.d.mts → iter-fest.iteratorFindIndex.d.mts} +4 -4
- package/dist/{iter-fest.iterableFindIndex.d.ts → iter-fest.iteratorFindIndex.d.ts} +4 -4
- package/dist/{iter-fest.iterableFindIndex.js → iter-fest.iteratorFindIndex.js} +23 -10
- package/dist/iter-fest.iteratorFindIndex.js.map +1 -0
- package/dist/iter-fest.iteratorFindIndex.mjs +8 -0
- package/dist/{iter-fest.iterableFindLast.d.mts → iter-fest.iteratorFindLast.d.mts} +5 -5
- package/dist/{iter-fest.iterableFindLast.d.ts → iter-fest.iteratorFindLast.d.ts} +5 -5
- package/dist/{iter-fest.iterableFindLast.js → iter-fest.iteratorFindLast.js} +23 -10
- package/dist/iter-fest.iteratorFindLast.js.map +1 -0
- package/dist/iter-fest.iteratorFindLast.mjs +8 -0
- package/dist/{iter-fest.iterableFindLastIndex.d.mts → iter-fest.iteratorFindLastIndex.d.mts} +4 -4
- package/dist/{iter-fest.iterableFindLastIndex.d.ts → iter-fest.iteratorFindLastIndex.d.ts} +4 -4
- package/dist/{iter-fest.iterableFindLastIndex.js → iter-fest.iteratorFindLastIndex.js} +23 -10
- package/dist/iter-fest.iteratorFindLastIndex.js.map +1 -0
- package/dist/iter-fest.iteratorFindLastIndex.mjs +8 -0
- package/dist/iter-fest.iteratorFlatMap.d.mts +12 -0
- package/dist/iter-fest.iteratorFlatMap.d.ts +12 -0
- package/dist/iter-fest.iteratorFlatMap.js +44 -0
- package/dist/iter-fest.iteratorFlatMap.js.map +1 -0
- package/dist/iter-fest.iteratorFlatMap.mjs +7 -0
- package/dist/iter-fest.iteratorForEach.d.mts +10 -0
- package/dist/iter-fest.iteratorForEach.d.ts +10 -0
- package/dist/iter-fest.iteratorForEach.js +44 -0
- package/dist/iter-fest.iteratorForEach.js.map +1 -0
- package/dist/iter-fest.iteratorForEach.mjs +7 -0
- package/dist/iter-fest.iteratorFrom.d.mts +12 -0
- package/dist/iter-fest.iteratorFrom.d.ts +12 -0
- package/dist/iter-fest.iteratorFrom.js +44 -0
- package/dist/iter-fest.iteratorFrom.js.map +1 -0
- package/dist/iter-fest.iteratorFrom.mjs +7 -0
- package/dist/iter-fest.iteratorIncludes.d.mts +9 -0
- package/dist/iter-fest.iteratorIncludes.d.ts +9 -0
- package/dist/{iter-fest.iterableIncludes.js → iter-fest.iteratorIncludes.js} +21 -10
- package/dist/iter-fest.iteratorIncludes.js.map +1 -0
- package/dist/iter-fest.iteratorIncludes.mjs +9 -0
- package/dist/iter-fest.iteratorIndexOf.d.mts +9 -0
- package/dist/iter-fest.iteratorIndexOf.d.ts +9 -0
- package/dist/{iter-fest.iterableIndexOf.js → iter-fest.iteratorIndexOf.js} +21 -10
- package/dist/iter-fest.iteratorIndexOf.js.map +1 -0
- package/dist/iter-fest.iteratorIndexOf.mjs +9 -0
- package/dist/iter-fest.iteratorJoin.d.mts +8 -0
- package/dist/iter-fest.iteratorJoin.d.ts +8 -0
- package/dist/{iter-fest.iterableToString.js → iter-fest.iteratorJoin.js} +21 -15
- package/dist/iter-fest.iteratorJoin.js.map +1 -0
- package/dist/iter-fest.iteratorJoin.mjs +8 -0
- package/dist/iter-fest.iteratorKeys.d.mts +6 -0
- package/dist/iter-fest.iteratorKeys.d.ts +6 -0
- package/dist/{iter-fest.iterableKeys.js → iter-fest.iteratorKeys.js} +22 -9
- package/dist/iter-fest.iteratorKeys.js.map +1 -0
- package/dist/iter-fest.iteratorKeys.mjs +8 -0
- package/dist/iter-fest.iteratorKeys.mjs.map +1 -0
- package/dist/iter-fest.iteratorMap.d.mts +10 -0
- package/dist/iter-fest.iteratorMap.d.ts +10 -0
- package/dist/iter-fest.iteratorMap.js +44 -0
- package/dist/iter-fest.iteratorMap.js.map +1 -0
- package/dist/iter-fest.iteratorMap.mjs +7 -0
- package/dist/iter-fest.iteratorMap.mjs.map +1 -0
- package/dist/{iter-fest.iterableReduce.d.mts → iter-fest.iteratorReduce.d.mts} +13 -9
- package/dist/{iter-fest.iterableReduce.d.ts → iter-fest.iteratorReduce.d.ts} +13 -9
- package/dist/iter-fest.iteratorReduce.js +44 -0
- package/dist/iter-fest.iteratorReduce.js.map +1 -0
- package/dist/iter-fest.iteratorReduce.mjs +7 -0
- package/dist/iter-fest.iteratorReduce.mjs.map +1 -0
- package/dist/{iter-fest.iterableSlice.d.mts → iter-fest.iteratorSlice.d.mts} +8 -8
- package/dist/{iter-fest.iterableSlice.d.ts → iter-fest.iteratorSlice.d.ts} +8 -8
- package/dist/{iter-fest.iterableSlice.js → iter-fest.iteratorSlice.js} +21 -10
- package/dist/iter-fest.iteratorSlice.js.map +1 -0
- package/dist/iter-fest.iteratorSlice.mjs +9 -0
- package/dist/iter-fest.iteratorSlice.mjs.map +1 -0
- package/dist/iter-fest.iteratorSome.d.mts +10 -0
- package/dist/iter-fest.iteratorSome.d.ts +10 -0
- package/dist/iter-fest.iteratorSome.js +44 -0
- package/dist/iter-fest.iteratorSome.js.map +1 -0
- package/dist/iter-fest.iteratorSome.mjs +7 -0
- package/dist/iter-fest.iteratorSome.mjs.map +1 -0
- package/dist/iter-fest.iteratorTake.d.mts +12 -0
- package/dist/iter-fest.iteratorTake.d.ts +12 -0
- package/dist/iter-fest.iteratorTake.js +44 -0
- package/dist/iter-fest.iteratorTake.js.map +1 -0
- package/dist/iter-fest.iteratorTake.mjs +7 -0
- package/dist/iter-fest.iteratorTake.mjs.map +1 -0
- package/dist/iter-fest.iteratorToArray.d.mts +13 -0
- package/dist/iter-fest.iteratorToArray.d.ts +13 -0
- package/dist/iter-fest.iteratorToArray.js +44 -0
- package/dist/iter-fest.iteratorToArray.js.map +1 -0
- package/dist/iter-fest.iteratorToArray.mjs +7 -0
- package/dist/iter-fest.iteratorToArray.mjs.map +1 -0
- package/dist/{iter-fest.iterableToSpliced.d.mts → iter-fest.iteratorToSpliced.d.mts} +3 -3
- package/dist/{iter-fest.iterableToSpliced.d.ts → iter-fest.iteratorToSpliced.d.ts} +3 -3
- package/dist/{iter-fest.iterableToSpliced.js → iter-fest.iteratorToSpliced.js} +21 -10
- package/dist/iter-fest.iteratorToSpliced.js.map +1 -0
- package/dist/iter-fest.iteratorToSpliced.mjs +9 -0
- package/dist/iter-fest.iteratorToSpliced.mjs.map +1 -0
- package/dist/iter-fest.iteratorToString.d.mts +6 -0
- package/dist/iter-fest.iteratorToString.d.ts +6 -0
- package/dist/{iter-fest.iterableJoin.js → iter-fest.iteratorToString.js} +27 -9
- package/dist/iter-fest.iteratorToString.js.map +1 -0
- package/dist/iter-fest.iteratorToString.mjs +9 -0
- package/dist/iter-fest.iteratorToString.mjs.map +1 -0
- package/dist/iter-fest.js +449 -201
- package/dist/iter-fest.js.map +1 -1
- package/dist/iter-fest.mjs +124 -64
- package/dist/iter-fest.observable.d.mts +51 -0
- package/dist/iter-fest.observable.d.ts +51 -0
- package/dist/iter-fest.observable.js +66 -0
- package/dist/iter-fest.observable.js.map +1 -0
- package/dist/iter-fest.observable.mjs +8 -0
- package/dist/iter-fest.observable.mjs.map +1 -0
- package/dist/iter-fest.observableFromAsync.d.mts +7 -0
- package/dist/iter-fest.observableFromAsync.d.ts +7 -0
- package/dist/iter-fest.observableFromAsync.js +91 -0
- package/dist/iter-fest.observableFromAsync.js.map +1 -0
- package/dist/iter-fest.observableFromAsync.mjs +9 -0
- package/dist/iter-fest.observableFromAsync.mjs.map +1 -0
- package/dist/iter-fest.observableSubscribeAsReadable.d.mts +7 -0
- package/dist/iter-fest.observableSubscribeAsReadable.d.ts +7 -0
- package/dist/iter-fest.observableSubscribeAsReadable.js +51 -0
- package/dist/iter-fest.observableSubscribeAsReadable.js.map +1 -0
- package/dist/iter-fest.observableSubscribeAsReadable.mjs +7 -0
- package/dist/iter-fest.observableSubscribeAsReadable.mjs.map +1 -0
- package/dist/iter-fest.readableStreamFrom.d.mts +3 -0
- package/dist/iter-fest.readableStreamFrom.d.ts +3 -0
- package/dist/{iter-fest.iterableEvery.js → iter-fest.readableStreamFrom.js} +21 -18
- package/dist/iter-fest.readableStreamFrom.js.map +1 -0
- package/dist/iter-fest.readableStreamFrom.mjs +7 -0
- package/dist/iter-fest.readableStreamFrom.mjs.map +1 -0
- package/dist/iter-fest.readerValues.d.mts +3 -0
- package/dist/iter-fest.readerValues.d.ts +3 -0
- package/dist/{iter-fest.iterableFilter.js → iter-fest.readerValues.js} +24 -17
- package/dist/iter-fest.readerValues.js.map +1 -0
- package/dist/iter-fest.readerValues.mjs +7 -0
- package/dist/iter-fest.readerValues.mjs.map +1 -0
- package/dist/iter-fest.symbolObservable.d.mts +3 -0
- package/dist/iter-fest.symbolObservable.d.ts +3 -0
- package/dist/iter-fest.symbolObservable.js +42 -0
- package/dist/iter-fest.symbolObservable.js.map +1 -0
- package/dist/iter-fest.symbolObservable.mjs +7 -0
- package/dist/iter-fest.symbolObservable.mjs.map +1 -0
- package/package.json +263 -109
- package/dist/chunk-27NJVC7K.mjs.map +0 -1
- package/dist/chunk-44W7OTNE.mjs +0 -12
- package/dist/chunk-44W7OTNE.mjs.map +0 -1
- package/dist/chunk-5CHMNKXJ.mjs +0 -20
- package/dist/chunk-5CHMNKXJ.mjs.map +0 -1
- package/dist/chunk-5CRMPYKD.mjs +0 -19
- package/dist/chunk-5CRMPYKD.mjs.map +0 -1
- package/dist/chunk-6C3P4TNK.mjs +0 -19
- package/dist/chunk-6C3P4TNK.mjs.map +0 -1
- package/dist/chunk-EZC33HE6.mjs +0 -15
- package/dist/chunk-EZC33HE6.mjs.map +0 -1
- package/dist/chunk-GWZF5BB7.mjs +0 -16
- package/dist/chunk-GWZF5BB7.mjs.map +0 -1
- package/dist/chunk-HYU4EN7J.mjs +0 -20
- package/dist/chunk-HYU4EN7J.mjs.map +0 -1
- package/dist/chunk-JU353VSE.mjs +0 -16
- package/dist/chunk-JU353VSE.mjs.map +0 -1
- package/dist/chunk-KONB7TV6.mjs.map +0 -1
- package/dist/chunk-MDBK7ND5.mjs.map +0 -1
- package/dist/chunk-MNLOWKTC.mjs +0 -19
- package/dist/chunk-MNLOWKTC.mjs.map +0 -1
- package/dist/chunk-TEI3K6GT.mjs +0 -21
- package/dist/chunk-TEI3K6GT.mjs.map +0 -1
- package/dist/chunk-UIEKIMLW.mjs.map +0 -1
- package/dist/chunk-V6OWQQ3Q.mjs +0 -20
- package/dist/chunk-V6OWQQ3Q.mjs.map +0 -1
- package/dist/chunk-WKIRSZXX.mjs.map +0 -1
- package/dist/chunk-XKBVB2JN.mjs +0 -12
- package/dist/chunk-XKBVB2JN.mjs.map +0 -1
- package/dist/chunk-XW34KZRY.mjs +0 -17
- package/dist/chunk-XW34KZRY.mjs.map +0 -1
- package/dist/chunk-Y5M2C7NQ.mjs +0 -13
- package/dist/chunk-Y5M2C7NQ.mjs.map +0 -1
- package/dist/chunk-ZUBHGSCW.mjs +0 -18
- package/dist/chunk-ZUBHGSCW.mjs.map +0 -1
- package/dist/iter-fest.iterableAt.js.map +0 -1
- package/dist/iter-fest.iterableAt.mjs +0 -8
- package/dist/iter-fest.iterableConcat.d.mts +0 -16
- package/dist/iter-fest.iterableConcat.d.ts +0 -16
- package/dist/iter-fest.iterableConcat.js.map +0 -1
- package/dist/iter-fest.iterableConcat.mjs +0 -7
- package/dist/iter-fest.iterableEntries.d.mts +0 -6
- package/dist/iter-fest.iterableEntries.d.ts +0 -6
- package/dist/iter-fest.iterableEntries.js.map +0 -1
- package/dist/iter-fest.iterableEntries.mjs +0 -7
- package/dist/iter-fest.iterableEvery.d.mts +0 -24
- package/dist/iter-fest.iterableEvery.d.ts +0 -24
- package/dist/iter-fest.iterableEvery.js.map +0 -1
- package/dist/iter-fest.iterableEvery.mjs +0 -7
- package/dist/iter-fest.iterableFilter.d.mts +0 -16
- package/dist/iter-fest.iterableFilter.d.ts +0 -16
- package/dist/iter-fest.iterableFilter.js.map +0 -1
- package/dist/iter-fest.iterableFilter.mjs +0 -7
- package/dist/iter-fest.iterableFind.d.mts +0 -15
- package/dist/iter-fest.iterableFind.d.ts +0 -15
- package/dist/iter-fest.iterableFind.js +0 -43
- package/dist/iter-fest.iterableFind.js.map +0 -1
- package/dist/iter-fest.iterableFind.mjs +0 -7
- package/dist/iter-fest.iterableFindIndex.js.map +0 -1
- package/dist/iter-fest.iterableFindIndex.mjs +0 -7
- package/dist/iter-fest.iterableFindLast.js.map +0 -1
- package/dist/iter-fest.iterableFindLast.mjs +0 -7
- package/dist/iter-fest.iterableFindLastIndex.js.map +0 -1
- package/dist/iter-fest.iterableFindLastIndex.mjs +0 -7
- package/dist/iter-fest.iterableForEach.d.mts +0 -10
- package/dist/iter-fest.iterableForEach.d.ts +0 -10
- package/dist/iter-fest.iterableForEach.js +0 -40
- package/dist/iter-fest.iterableForEach.js.map +0 -1
- package/dist/iter-fest.iterableForEach.mjs +0 -7
- package/dist/iter-fest.iterableIncludes.d.mts +0 -9
- package/dist/iter-fest.iterableIncludes.d.ts +0 -9
- package/dist/iter-fest.iterableIncludes.js.map +0 -1
- package/dist/iter-fest.iterableIncludes.mjs +0 -8
- package/dist/iter-fest.iterableIndexOf.d.mts +0 -9
- package/dist/iter-fest.iterableIndexOf.d.ts +0 -9
- package/dist/iter-fest.iterableIndexOf.js.map +0 -1
- package/dist/iter-fest.iterableIndexOf.mjs +0 -8
- package/dist/iter-fest.iterableJoin.d.mts +0 -8
- package/dist/iter-fest.iterableJoin.d.ts +0 -8
- package/dist/iter-fest.iterableJoin.js.map +0 -1
- package/dist/iter-fest.iterableJoin.mjs +0 -7
- package/dist/iter-fest.iterableKeys.d.mts +0 -6
- package/dist/iter-fest.iterableKeys.d.ts +0 -6
- package/dist/iter-fest.iterableKeys.js.map +0 -1
- package/dist/iter-fest.iterableKeys.mjs +0 -7
- package/dist/iter-fest.iterableMap.d.mts +0 -8
- package/dist/iter-fest.iterableMap.d.ts +0 -8
- package/dist/iter-fest.iterableMap.js +0 -39
- package/dist/iter-fest.iterableMap.js.map +0 -1
- package/dist/iter-fest.iterableMap.mjs +0 -7
- package/dist/iter-fest.iterableReduce.js +0 -41
- package/dist/iter-fest.iterableReduce.js.map +0 -1
- package/dist/iter-fest.iterableReduce.mjs +0 -7
- package/dist/iter-fest.iterableSlice.js.map +0 -1
- package/dist/iter-fest.iterableSlice.mjs +0 -8
- package/dist/iter-fest.iterableSome.d.mts +0 -12
- package/dist/iter-fest.iterableSome.d.ts +0 -12
- package/dist/iter-fest.iterableSome.js +0 -43
- package/dist/iter-fest.iterableSome.js.map +0 -1
- package/dist/iter-fest.iterableSome.mjs +0 -7
- package/dist/iter-fest.iterableToSpliced.js.map +0 -1
- package/dist/iter-fest.iterableToSpliced.mjs +0 -8
- package/dist/iter-fest.iterableToString.d.mts +0 -6
- package/dist/iter-fest.iterableToString.d.ts +0 -6
- package/dist/iter-fest.iterableToString.js.map +0 -1
- package/dist/iter-fest.iterableToString.mjs +0 -8
- /package/dist/{iter-fest.iterableAt.mjs.map → iter-fest.asyncGeneratorWithLastValue.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableConcat.mjs.map → iter-fest.asyncIteratorToAsyncIterable.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableEntries.mjs.map → iter-fest.generatorWithLastValue.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableEvery.mjs.map → iter-fest.iterableWritableStream.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableFilter.mjs.map → iter-fest.iteratorAt.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableFind.mjs.map → iter-fest.iteratorConcat.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableFindIndex.mjs.map → iter-fest.iteratorDrop.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableFindLast.mjs.map → iter-fest.iteratorEntries.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableFindLastIndex.mjs.map → iter-fest.iteratorEvery.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableForEach.mjs.map → iter-fest.iteratorFilter.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableIncludes.mjs.map → iter-fest.iteratorFind.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableIndexOf.mjs.map → iter-fest.iteratorFindIndex.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableJoin.mjs.map → iter-fest.iteratorFindLast.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableKeys.mjs.map → iter-fest.iteratorFindLastIndex.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableMap.mjs.map → iter-fest.iteratorFlatMap.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableReduce.mjs.map → iter-fest.iteratorForEach.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableSlice.mjs.map → iter-fest.iteratorFrom.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableSome.mjs.map → iter-fest.iteratorIncludes.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableToSpliced.mjs.map → iter-fest.iteratorIndexOf.mjs.map} +0 -0
- /package/dist/{iter-fest.iterableToString.mjs.map → iter-fest.iteratorJoin.mjs.map} +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// src/readableStreamFrom.ts
|
|
2
|
+
function isIterable(iterable) {
|
|
3
|
+
return !!(iterable && typeof iterable === "object" && Symbol.iterator in iterable);
|
|
4
|
+
}
|
|
5
|
+
function readableStreamFrom(anyIterable) {
|
|
6
|
+
const iterator = isIterable(anyIterable) ? anyIterable[Symbol.iterator]() : anyIterable[Symbol.asyncIterator]();
|
|
7
|
+
return new ReadableStream({
|
|
8
|
+
async pull(controller) {
|
|
9
|
+
const result = await iterator.next();
|
|
10
|
+
if (result.done) {
|
|
11
|
+
controller.close();
|
|
12
|
+
} else {
|
|
13
|
+
controller.enqueue(result.value);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
readableStreamFrom
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=chunk-YJSIVBF7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/readableStreamFrom.ts"],"sourcesContent":["function isIterable(iterable: unknown): iterable is Iterable<unknown> {\n return !!(iterable && typeof iterable === 'object' && Symbol.iterator in iterable);\n}\n\nexport function readableStreamFrom<T>(anyIterable: AsyncIterable<T> | Iterable<T>): ReadableStream<T> {\n const iterator = isIterable(anyIterable) ? anyIterable[Symbol.iterator]() : anyIterable[Symbol.asyncIterator]();\n\n return new ReadableStream({\n async pull(controller) {\n const result = await iterator.next();\n\n if (result.done) {\n controller.close();\n } else {\n controller.enqueue(result.value);\n }\n }\n });\n}\n"],"mappings":";AAAA,SAAS,WAAW,UAAkD;AACpE,SAAO,CAAC,EAAE,YAAY,OAAO,aAAa,YAAY,OAAO,YAAY;AAC3E;AAEO,SAAS,mBAAsB,aAAgE;AACpG,QAAM,WAAW,WAAW,WAAW,IAAI,YAAY,OAAO,QAAQ,EAAE,IAAI,YAAY,OAAO,aAAa,EAAE;AAE9G,SAAO,IAAI,eAAe;AAAA,IACxB,MAAM,KAAK,YAAY;AACrB,YAAM,SAAS,MAAM,SAAS,KAAK;AAEnC,UAAI,OAAO,MAAM;AACf,mBAAW,MAAM;AAAA,MACnB,OAAO;AACL,mBAAW,QAAQ,OAAO,KAAK;AAAA,MACjC;AAAA,IACF;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/iteratorToArray.ts"],"sourcesContent":["// @ts-expect-error core-js-pure is not typed.\nimport toArray from 'core-js-pure/full/iterator/to-array';\n\ntype IteratorLike<T> = Pick<Iterator<T>, 'next'>;\n\n/**\n * When you have a non-infinite iterator which you wish to transform into an array, you can do so with the builtin toArray method.\n *\n * @param limit\n *\n * @return Returns an Array containing the values from the iterator.\n *\n * @link https://github.com/tc39/proposal-iterator-helpers/blob/main/README.md\n */\nexport function iteratorToArray<T>(iteratorLike: IteratorLike<T>): T[] {\n return toArray(iteratorLike);\n}\n"],"mappings":";AACA,OAAO,aAAa;AAab,SAAS,gBAAmB,cAAoC;AACrE,SAAO,QAAQ,YAAY;AAC7B;","names":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type AsyncGeneratorWithLastValue<T = unknown, TReturn = any, TNext = unknown> = AsyncGenerator<T, TReturn, TNext> & {
|
|
2
|
+
lastValue(): TReturn;
|
|
3
|
+
};
|
|
4
|
+
declare function asyncGeneratorWithLastValue<T = unknown, TReturn = any, TNext = unknown>(generator: AsyncGenerator<T, TReturn, TNext>): AsyncGeneratorWithLastValue<T, TReturn, TNext>;
|
|
5
|
+
|
|
6
|
+
export { type AsyncGeneratorWithLastValue, asyncGeneratorWithLastValue };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type AsyncGeneratorWithLastValue<T = unknown, TReturn = any, TNext = unknown> = AsyncGenerator<T, TReturn, TNext> & {
|
|
2
|
+
lastValue(): TReturn;
|
|
3
|
+
};
|
|
4
|
+
declare function asyncGeneratorWithLastValue<T = unknown, TReturn = any, TNext = unknown>(generator: AsyncGenerator<T, TReturn, TNext>): AsyncGeneratorWithLastValue<T, TReturn, TNext>;
|
|
5
|
+
|
|
6
|
+
export { type AsyncGeneratorWithLastValue, asyncGeneratorWithLastValue };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/asyncGeneratorWithLastValue.ts
|
|
21
|
+
var asyncGeneratorWithLastValue_exports = {};
|
|
22
|
+
__export(asyncGeneratorWithLastValue_exports, {
|
|
23
|
+
asyncGeneratorWithLastValue: () => asyncGeneratorWithLastValue
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(asyncGeneratorWithLastValue_exports);
|
|
26
|
+
var STILL_ITERATING = Symbol();
|
|
27
|
+
function asyncGeneratorWithLastValue(generator) {
|
|
28
|
+
let lastValue = STILL_ITERATING;
|
|
29
|
+
const asyncGeneratorWithLastValue2 = {
|
|
30
|
+
[Symbol.asyncIterator]() {
|
|
31
|
+
return asyncGeneratorWithLastValue2;
|
|
32
|
+
},
|
|
33
|
+
lastValue() {
|
|
34
|
+
if (lastValue === STILL_ITERATING) {
|
|
35
|
+
throw new Error("Iteration has not complete yet, cannot get last value.");
|
|
36
|
+
}
|
|
37
|
+
return lastValue;
|
|
38
|
+
},
|
|
39
|
+
async next(next) {
|
|
40
|
+
const result = await generator.next(next);
|
|
41
|
+
if (result.done) {
|
|
42
|
+
lastValue = result.value;
|
|
43
|
+
}
|
|
44
|
+
return result;
|
|
45
|
+
},
|
|
46
|
+
return(value) {
|
|
47
|
+
return generator.return(value);
|
|
48
|
+
},
|
|
49
|
+
throw(error) {
|
|
50
|
+
return generator.throw(error);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
return asyncGeneratorWithLastValue2;
|
|
54
|
+
}
|
|
55
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
+
0 && (module.exports = {
|
|
57
|
+
asyncGeneratorWithLastValue
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=iter-fest.asyncGeneratorWithLastValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/asyncGeneratorWithLastValue.ts"],"sourcesContent":["const STILL_ITERATING = Symbol();\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AsyncGeneratorWithLastValue<T = unknown, TReturn = any, TNext = unknown> = AsyncGenerator<\n T,\n TReturn,\n TNext\n> & {\n lastValue(): TReturn;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function asyncGeneratorWithLastValue<T = unknown, TReturn = any, TNext = unknown>(\n generator: AsyncGenerator<T, TReturn, TNext>\n): AsyncGeneratorWithLastValue<T, TReturn, TNext> {\n let lastValue: typeof STILL_ITERATING | TReturn = STILL_ITERATING;\n\n const asyncGeneratorWithLastValue = {\n [Symbol.asyncIterator]() {\n return asyncGeneratorWithLastValue;\n },\n lastValue(): TReturn {\n if (lastValue === STILL_ITERATING) {\n throw new Error('Iteration has not complete yet, cannot get last value.');\n }\n\n return lastValue;\n },\n async next(next: TNext) {\n const result = await generator.next(next);\n\n if (result.done) {\n lastValue = result.value;\n }\n\n return result;\n },\n return(value: TReturn) {\n return generator.return(value);\n },\n throw(error: unknown) {\n return generator.throw(error);\n }\n };\n\n return asyncGeneratorWithLastValue;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAM,kBAAkB,OAAO;AAYxB,SAAS,4BACd,WACgD;AAChD,MAAI,YAA8C;AAElD,QAAMA,+BAA8B;AAAA,IAClC,CAAC,OAAO,aAAa,IAAI;AACvB,aAAOA;AAAA,IACT;AAAA,IACA,YAAqB;AACnB,UAAI,cAAc,iBAAiB;AACjC,cAAM,IAAI,MAAM,wDAAwD;AAAA,MAC1E;AAEA,aAAO;AAAA,IACT;AAAA,IACA,MAAM,KAAK,MAAa;AACtB,YAAM,SAAS,MAAM,UAAU,KAAK,IAAI;AAExC,UAAI,OAAO,MAAM;AACf,oBAAY,OAAO;AAAA,MACrB;AAEA,aAAO;AAAA,IACT;AAAA,IACA,OAAO,OAAgB;AACrB,aAAO,UAAU,OAAO,KAAK;AAAA,IAC/B;AAAA,IACA,MAAM,OAAgB;AACpB,aAAO,UAAU,MAAM,KAAK;AAAA,IAC9B;AAAA,EACF;AAEA,SAAOA;AACT;","names":["asyncGeneratorWithLastValue"]}
|
|
@@ -17,24 +17,23 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
|
-
// src/
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
23
|
-
|
|
20
|
+
// src/asyncIteratorToAsyncIterable.ts
|
|
21
|
+
var asyncIteratorToAsyncIterable_exports = {};
|
|
22
|
+
__export(asyncIteratorToAsyncIterable_exports, {
|
|
23
|
+
asyncIteratorToAsyncIterable: () => asyncIteratorToAsyncIterable
|
|
24
24
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
25
|
+
module.exports = __toCommonJS(asyncIteratorToAsyncIterable_exports);
|
|
26
|
+
function asyncIteratorToAsyncIterable(asyncIterator) {
|
|
27
|
+
const asyncIterableIterator = {
|
|
28
|
+
[Symbol.asyncIterator]: () => asyncIterableIterator,
|
|
29
|
+
next: asyncIterator.next.bind(asyncIterator),
|
|
30
|
+
...asyncIterator.return ? { return: asyncIterator.return.bind(asyncIterator) } : {},
|
|
31
|
+
...asyncIterator.throw ? { throw: asyncIterator.throw.bind(asyncIterator) } : {}
|
|
32
|
+
};
|
|
33
|
+
return asyncIterableIterator;
|
|
35
34
|
}
|
|
36
35
|
// Annotate the CommonJS export names for ESM import in node:
|
|
37
36
|
0 && (module.exports = {
|
|
38
|
-
|
|
37
|
+
asyncIteratorToAsyncIterable
|
|
39
38
|
});
|
|
40
|
-
//# sourceMappingURL=iter-fest.
|
|
39
|
+
//# sourceMappingURL=iter-fest.asyncIteratorToAsyncIterable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/asyncIteratorToAsyncIterable.ts"],"sourcesContent":["export function asyncIteratorToAsyncIterable<T>(asyncIterator: AsyncIterator<T>): AsyncIterableIterator<T> {\n const asyncIterableIterator: AsyncIterableIterator<T> = {\n [Symbol.asyncIterator]: () => asyncIterableIterator,\n next: asyncIterator.next.bind(asyncIterator),\n ...(asyncIterator.return ? { return: asyncIterator.return.bind(asyncIterator) } : {}),\n ...(asyncIterator.throw ? { throw: asyncIterator.throw.bind(asyncIterator) } : {})\n };\n\n return asyncIterableIterator;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,SAAS,6BAAgC,eAA2D;AACzG,QAAM,wBAAkD;AAAA,IACtD,CAAC,OAAO,aAAa,GAAG,MAAM;AAAA,IAC9B,MAAM,cAAc,KAAK,KAAK,aAAa;AAAA,IAC3C,GAAI,cAAc,SAAS,EAAE,QAAQ,cAAc,OAAO,KAAK,aAAa,EAAE,IAAI,CAAC;AAAA,IACnF,GAAI,cAAc,QAAQ,EAAE,OAAO,cAAc,MAAM,KAAK,aAAa,EAAE,IAAI,CAAC;AAAA,EAClF;AAEA,SAAO;AACT;","names":[]}
|
package/dist/iter-fest.d.mts
CHANGED
|
@@ -1,21 +1,37 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
1
|
+
export { CompleteFunction, ErrorFunction, NextFunction, Observable, Observer, StartFunction, SubscriberFunction, Subscription, SubscriptionObserver } from './iter-fest.observable.mjs';
|
|
2
|
+
export { SymbolObservable } from './iter-fest.symbolObservable.mjs';
|
|
3
|
+
export { AsyncGeneratorWithLastValue, asyncGeneratorWithLastValue } from './iter-fest.asyncGeneratorWithLastValue.mjs';
|
|
4
|
+
export { asyncIteratorToAsyncIterable } from './iter-fest.asyncIteratorToAsyncIterable.mjs';
|
|
5
|
+
export { GeneratorWithLastValue, generatorWithLastValue } from './iter-fest.generatorWithLastValue.mjs';
|
|
6
|
+
export { iteratorSlice } from './iter-fest.iteratorSlice.mjs';
|
|
7
|
+
export { IterableWritableStream } from './iter-fest.iterableWritableStream.mjs';
|
|
8
|
+
export { iteratorAt } from './iter-fest.iteratorAt.mjs';
|
|
9
|
+
export { iteratorConcat } from './iter-fest.iteratorConcat.mjs';
|
|
10
|
+
export { iteratorDrop } from './iter-fest.iteratorDrop.mjs';
|
|
11
|
+
export { iteratorEntries } from './iter-fest.iteratorEntries.mjs';
|
|
12
|
+
export { iteratorEvery } from './iter-fest.iteratorEvery.mjs';
|
|
13
|
+
export { iteratorFilter } from './iter-fest.iteratorFilter.mjs';
|
|
14
|
+
export { iteratorFind } from './iter-fest.iteratorFind.mjs';
|
|
15
|
+
export { iteratorFindIndex } from './iter-fest.iteratorFindIndex.mjs';
|
|
16
|
+
export { iteratorFindLast } from './iter-fest.iteratorFindLast.mjs';
|
|
17
|
+
export { iteratorFindLastIndex } from './iter-fest.iteratorFindLastIndex.mjs';
|
|
18
|
+
export { iteratorFlatMap } from './iter-fest.iteratorFlatMap.mjs';
|
|
19
|
+
export { iteratorForEach } from './iter-fest.iteratorForEach.mjs';
|
|
20
|
+
export { iteratorFrom } from './iter-fest.iteratorFrom.mjs';
|
|
21
|
+
export { iteratorIncludes } from './iter-fest.iteratorIncludes.mjs';
|
|
22
|
+
export { iteratorIndexOf } from './iter-fest.iteratorIndexOf.mjs';
|
|
23
|
+
export { iteratorJoin } from './iter-fest.iteratorJoin.mjs';
|
|
24
|
+
export { iteratorKeys } from './iter-fest.iteratorKeys.mjs';
|
|
25
|
+
export { iteratorMap } from './iter-fest.iteratorMap.mjs';
|
|
26
|
+
export { iteratorReduce } from './iter-fest.iteratorReduce.mjs';
|
|
27
|
+
export { iteratorSome } from './iter-fest.iteratorSome.mjs';
|
|
28
|
+
export { iteratorTake } from './iter-fest.iteratorTake.mjs';
|
|
29
|
+
export { iteratorToArray } from './iter-fest.iteratorToArray.mjs';
|
|
21
30
|
export { iteratorToIterable } from './iter-fest.iteratorToIterable.mjs';
|
|
31
|
+
export { iteratorToSpliced } from './iter-fest.iteratorToSpliced.mjs';
|
|
32
|
+
export { iteratorToString } from './iter-fest.iteratorToString.mjs';
|
|
33
|
+
export { observableFromAsync } from './iter-fest.observableFromAsync.mjs';
|
|
34
|
+
export { observableSubscribeAsReadable } from './iter-fest.observableSubscribeAsReadable.mjs';
|
|
35
|
+
export { readableStreamFrom } from './iter-fest.readableStreamFrom.mjs';
|
|
36
|
+
export { readerValues } from './iter-fest.readerValues.mjs';
|
|
37
|
+
import 'core-js-pure/full/observable';
|
package/dist/iter-fest.d.ts
CHANGED
|
@@ -1,21 +1,37 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
1
|
+
export { CompleteFunction, ErrorFunction, NextFunction, Observable, Observer, StartFunction, SubscriberFunction, Subscription, SubscriptionObserver } from './iter-fest.observable.js';
|
|
2
|
+
export { SymbolObservable } from './iter-fest.symbolObservable.js';
|
|
3
|
+
export { AsyncGeneratorWithLastValue, asyncGeneratorWithLastValue } from './iter-fest.asyncGeneratorWithLastValue.js';
|
|
4
|
+
export { asyncIteratorToAsyncIterable } from './iter-fest.asyncIteratorToAsyncIterable.js';
|
|
5
|
+
export { GeneratorWithLastValue, generatorWithLastValue } from './iter-fest.generatorWithLastValue.js';
|
|
6
|
+
export { iteratorSlice } from './iter-fest.iteratorSlice.js';
|
|
7
|
+
export { IterableWritableStream } from './iter-fest.iterableWritableStream.js';
|
|
8
|
+
export { iteratorAt } from './iter-fest.iteratorAt.js';
|
|
9
|
+
export { iteratorConcat } from './iter-fest.iteratorConcat.js';
|
|
10
|
+
export { iteratorDrop } from './iter-fest.iteratorDrop.js';
|
|
11
|
+
export { iteratorEntries } from './iter-fest.iteratorEntries.js';
|
|
12
|
+
export { iteratorEvery } from './iter-fest.iteratorEvery.js';
|
|
13
|
+
export { iteratorFilter } from './iter-fest.iteratorFilter.js';
|
|
14
|
+
export { iteratorFind } from './iter-fest.iteratorFind.js';
|
|
15
|
+
export { iteratorFindIndex } from './iter-fest.iteratorFindIndex.js';
|
|
16
|
+
export { iteratorFindLast } from './iter-fest.iteratorFindLast.js';
|
|
17
|
+
export { iteratorFindLastIndex } from './iter-fest.iteratorFindLastIndex.js';
|
|
18
|
+
export { iteratorFlatMap } from './iter-fest.iteratorFlatMap.js';
|
|
19
|
+
export { iteratorForEach } from './iter-fest.iteratorForEach.js';
|
|
20
|
+
export { iteratorFrom } from './iter-fest.iteratorFrom.js';
|
|
21
|
+
export { iteratorIncludes } from './iter-fest.iteratorIncludes.js';
|
|
22
|
+
export { iteratorIndexOf } from './iter-fest.iteratorIndexOf.js';
|
|
23
|
+
export { iteratorJoin } from './iter-fest.iteratorJoin.js';
|
|
24
|
+
export { iteratorKeys } from './iter-fest.iteratorKeys.js';
|
|
25
|
+
export { iteratorMap } from './iter-fest.iteratorMap.js';
|
|
26
|
+
export { iteratorReduce } from './iter-fest.iteratorReduce.js';
|
|
27
|
+
export { iteratorSome } from './iter-fest.iteratorSome.js';
|
|
28
|
+
export { iteratorTake } from './iter-fest.iteratorTake.js';
|
|
29
|
+
export { iteratorToArray } from './iter-fest.iteratorToArray.js';
|
|
21
30
|
export { iteratorToIterable } from './iter-fest.iteratorToIterable.js';
|
|
31
|
+
export { iteratorToSpliced } from './iter-fest.iteratorToSpliced.js';
|
|
32
|
+
export { iteratorToString } from './iter-fest.iteratorToString.js';
|
|
33
|
+
export { observableFromAsync } from './iter-fest.observableFromAsync.js';
|
|
34
|
+
export { observableSubscribeAsReadable } from './iter-fest.observableSubscribeAsReadable.js';
|
|
35
|
+
export { readableStreamFrom } from './iter-fest.readableStreamFrom.js';
|
|
36
|
+
export { readerValues } from './iter-fest.readerValues.js';
|
|
37
|
+
import 'core-js-pure/full/observable';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type GeneratorWithLastValue<T = unknown, TReturn = any, TNext = unknown> = Generator<T, TReturn, TNext> & {
|
|
2
|
+
lastValue(): TReturn;
|
|
3
|
+
};
|
|
4
|
+
declare function generatorWithLastValue<T = unknown, TReturn = any, TNext = unknown>(generator: Generator<T, TReturn, TNext>): GeneratorWithLastValue<T, TReturn, TNext>;
|
|
5
|
+
|
|
6
|
+
export { type GeneratorWithLastValue, generatorWithLastValue };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type GeneratorWithLastValue<T = unknown, TReturn = any, TNext = unknown> = Generator<T, TReturn, TNext> & {
|
|
2
|
+
lastValue(): TReturn;
|
|
3
|
+
};
|
|
4
|
+
declare function generatorWithLastValue<T = unknown, TReturn = any, TNext = unknown>(generator: Generator<T, TReturn, TNext>): GeneratorWithLastValue<T, TReturn, TNext>;
|
|
5
|
+
|
|
6
|
+
export { type GeneratorWithLastValue, generatorWithLastValue };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/generatorWithLastValue.ts
|
|
21
|
+
var generatorWithLastValue_exports = {};
|
|
22
|
+
__export(generatorWithLastValue_exports, {
|
|
23
|
+
generatorWithLastValue: () => generatorWithLastValue
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(generatorWithLastValue_exports);
|
|
26
|
+
var STILL_ITERATING = Symbol();
|
|
27
|
+
function generatorWithLastValue(generator) {
|
|
28
|
+
let lastValue = STILL_ITERATING;
|
|
29
|
+
const generatorWithLastValue2 = {
|
|
30
|
+
[Symbol.iterator]() {
|
|
31
|
+
return generatorWithLastValue2;
|
|
32
|
+
},
|
|
33
|
+
lastValue() {
|
|
34
|
+
if (lastValue === STILL_ITERATING) {
|
|
35
|
+
throw new Error("Iteration has not complete yet, cannot get last value.");
|
|
36
|
+
}
|
|
37
|
+
return lastValue;
|
|
38
|
+
},
|
|
39
|
+
next(next) {
|
|
40
|
+
const result = generator.next(next);
|
|
41
|
+
if (result.done) {
|
|
42
|
+
lastValue = result.value;
|
|
43
|
+
}
|
|
44
|
+
return result;
|
|
45
|
+
},
|
|
46
|
+
return(value) {
|
|
47
|
+
return generator.return(value);
|
|
48
|
+
},
|
|
49
|
+
throw(error) {
|
|
50
|
+
return generator.throw(error);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
return generatorWithLastValue2;
|
|
54
|
+
}
|
|
55
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
+
0 && (module.exports = {
|
|
57
|
+
generatorWithLastValue
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=iter-fest.generatorWithLastValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/generatorWithLastValue.ts"],"sourcesContent":["const STILL_ITERATING = Symbol();\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type GeneratorWithLastValue<T = unknown, TReturn = any, TNext = unknown> = Generator<T, TReturn, TNext> & {\n lastValue(): TReturn;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function generatorWithLastValue<T = unknown, TReturn = any, TNext = unknown>(\n generator: Generator<T, TReturn, TNext>\n): GeneratorWithLastValue<T, TReturn, TNext> {\n let lastValue: typeof STILL_ITERATING | TReturn = STILL_ITERATING;\n\n const generatorWithLastValue = {\n [Symbol.iterator]() {\n return generatorWithLastValue;\n },\n lastValue(): TReturn {\n if (lastValue === STILL_ITERATING) {\n throw new Error('Iteration has not complete yet, cannot get last value.');\n }\n\n return lastValue;\n },\n next(next: TNext) {\n const result = generator.next(next);\n\n if (result.done) {\n lastValue = result.value;\n }\n\n return result;\n },\n return(value: TReturn) {\n return generator.return(value);\n },\n throw(error: unknown) {\n return generator.throw(error);\n }\n };\n\n return generatorWithLastValue;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAM,kBAAkB,OAAO;AAQxB,SAAS,uBACd,WAC2C;AAC3C,MAAI,YAA8C;AAElD,QAAMA,0BAAyB;AAAA,IAC7B,CAAC,OAAO,QAAQ,IAAI;AAClB,aAAOA;AAAA,IACT;AAAA,IACA,YAAqB;AACnB,UAAI,cAAc,iBAAiB;AACjC,cAAM,IAAI,MAAM,wDAAwD;AAAA,MAC1E;AAEA,aAAO;AAAA,IACT;AAAA,IACA,KAAK,MAAa;AAChB,YAAM,SAAS,UAAU,KAAK,IAAI;AAElC,UAAI,OAAO,MAAM;AACf,oBAAY,OAAO;AAAA,MACrB;AAEA,aAAO;AAAA,IACT;AAAA,IACA,OAAO,OAAgB;AACrB,aAAO,UAAU,OAAO,KAAK;AAAA,IAC/B;AAAA,IACA,MAAM,OAAgB;AACpB,aAAO,UAAU,MAAM,KAAK;AAAA,IAC9B;AAAA,EACF;AAEA,SAAOA;AACT;","names":["generatorWithLastValue"]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/iterableWritableStream.ts
|
|
31
|
+
var iterableWritableStream_exports = {};
|
|
32
|
+
__export(iterableWritableStream_exports, {
|
|
33
|
+
IterableWritableStream: () => IterableWritableStream
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(iterableWritableStream_exports);
|
|
36
|
+
|
|
37
|
+
// src/private/withResolvers.ts
|
|
38
|
+
var import_with_resolvers = __toESM(require("core-js-pure/full/promise/with-resolvers"));
|
|
39
|
+
function withResolvers() {
|
|
40
|
+
return (0, import_with_resolvers.default)();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// src/iterableWritableStream.ts
|
|
44
|
+
var CLOSE = Symbol();
|
|
45
|
+
var IterableWritableStream = class extends WritableStream {
|
|
46
|
+
constructor() {
|
|
47
|
+
super({
|
|
48
|
+
close: () => {
|
|
49
|
+
this.#buffer.push(CLOSE);
|
|
50
|
+
this.#writeResolvers.resolve();
|
|
51
|
+
},
|
|
52
|
+
write: (chunk) => {
|
|
53
|
+
this.#buffer.push(chunk);
|
|
54
|
+
this.#writeResolvers.resolve();
|
|
55
|
+
this.#writeResolvers = withResolvers();
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
#buffer = [];
|
|
60
|
+
#writeResolvers = withResolvers();
|
|
61
|
+
[Symbol.asyncIterator]() {
|
|
62
|
+
return {
|
|
63
|
+
next: async () => {
|
|
64
|
+
while (!this.#buffer.length) {
|
|
65
|
+
await this.#writeResolvers.promise;
|
|
66
|
+
}
|
|
67
|
+
const value = this.#buffer[0];
|
|
68
|
+
if (value === CLOSE) {
|
|
69
|
+
return { done: true, value: void 0 };
|
|
70
|
+
}
|
|
71
|
+
this.#buffer.shift();
|
|
72
|
+
await void 0;
|
|
73
|
+
return { done: false, value };
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
79
|
+
0 && (module.exports = {
|
|
80
|
+
IterableWritableStream
|
|
81
|
+
});
|
|
82
|
+
//# sourceMappingURL=iter-fest.iterableWritableStream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/iterableWritableStream.ts","../src/private/withResolvers.ts"],"sourcesContent":["import withResolvers from './private/withResolvers';\n\nconst CLOSE = Symbol();\n\nexport class IterableWritableStream<T> extends WritableStream<T> {\n constructor() {\n super({\n close: () => {\n this.#buffer.push(CLOSE);\n this.#writeResolvers.resolve();\n },\n write: (chunk: T) => {\n this.#buffer.push(chunk);\n this.#writeResolvers.resolve();\n this.#writeResolvers = withResolvers();\n }\n });\n }\n\n #buffer: (T | typeof CLOSE)[] = [];\n #writeResolvers: PromiseWithResolvers<void> = withResolvers();\n\n [Symbol.asyncIterator](): AsyncIterator<T> {\n return {\n next: async () => {\n while (!this.#buffer.length) {\n await this.#writeResolvers.promise;\n }\n\n const value = this.#buffer[0] as T | typeof CLOSE;\n\n if (value === CLOSE) {\n return { done: true, value: undefined };\n }\n\n // If it is not CLOSE, remove it from the queue.\n this.#buffer.shift();\n\n // Idle here so concurrent iteration has a chance to pick up the next value in a round robin fashion.\n await undefined;\n\n return { done: false, value };\n }\n };\n }\n}\n","// @ts-expect-error \"core-js\" is not typed.\nimport coreJSPromiseWithResolvers from 'core-js-pure/full/promise/with-resolvers';\n\nexport default function withResolvers<T>(): PromiseWithResolvers<T> {\n return coreJSPromiseWithResolvers();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,4BAAuC;AAExB,SAAR,gBAA6D;AAClE,aAAO,sBAAAA,SAA2B;AACpC;;;ADHA,IAAM,QAAQ,OAAO;AAEd,IAAM,yBAAN,cAAwC,eAAkB;AAAA,EAC/D,cAAc;AACZ,UAAM;AAAA,MACJ,OAAO,MAAM;AACX,aAAK,QAAQ,KAAK,KAAK;AACvB,aAAK,gBAAgB,QAAQ;AAAA,MAC/B;AAAA,MACA,OAAO,CAAC,UAAa;AACnB,aAAK,QAAQ,KAAK,KAAK;AACvB,aAAK,gBAAgB,QAAQ;AAC7B,aAAK,kBAAkB,cAAc;AAAA,MACvC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,UAAgC,CAAC;AAAA,EACjC,kBAA8C,cAAc;AAAA,EAE5D,CAAC,OAAO,aAAa,IAAsB;AACzC,WAAO;AAAA,MACL,MAAM,YAAY;AAChB,eAAO,CAAC,KAAK,QAAQ,QAAQ;AAC3B,gBAAM,KAAK,gBAAgB;AAAA,QAC7B;AAEA,cAAM,QAAQ,KAAK,QAAQ,CAAC;AAE5B,YAAI,UAAU,OAAO;AACnB,iBAAO,EAAE,MAAM,MAAM,OAAO,OAAU;AAAA,QACxC;AAGA,aAAK,QAAQ,MAAM;AAGnB,cAAM;AAEN,eAAO,EAAE,MAAM,OAAO,MAAM;AAAA,MAC9B;AAAA,IACF;AAAA,EACF;AACF;","names":["coreJSPromiseWithResolvers"]}
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
|
|
5
5
|
*/
|
|
6
|
-
declare function
|
|
6
|
+
declare function iteratorAt<T>(iterator: Iterator<T>, index: number): T | undefined;
|
|
7
7
|
|
|
8
|
-
export {
|
|
8
|
+
export { iteratorAt };
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
|
|
5
5
|
*/
|
|
6
|
-
declare function
|
|
6
|
+
declare function iteratorAt<T>(iterator: Iterator<T>, index: number): T | undefined;
|
|
7
7
|
|
|
8
|
-
export {
|
|
8
|
+
export { iteratorAt };
|
|
@@ -17,12 +17,23 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
|
-
// src/
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
23
|
-
|
|
20
|
+
// src/iteratorAt.ts
|
|
21
|
+
var iteratorAt_exports = {};
|
|
22
|
+
__export(iteratorAt_exports, {
|
|
23
|
+
iteratorAt: () => iteratorAt
|
|
24
24
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
25
|
+
module.exports = __toCommonJS(iteratorAt_exports);
|
|
26
|
+
|
|
27
|
+
// src/iteratorToIterable.ts
|
|
28
|
+
function iteratorToIterable(iterator) {
|
|
29
|
+
const iterableIterator = {
|
|
30
|
+
[Symbol.iterator]: () => iterableIterator,
|
|
31
|
+
next: iterator.next.bind(iterator),
|
|
32
|
+
...iterator.return ? { return: iterator.return.bind(iterator) } : {},
|
|
33
|
+
...iterator.throw ? { throw: iterator.throw.bind(iterator) } : {}
|
|
34
|
+
};
|
|
35
|
+
return iterableIterator;
|
|
36
|
+
}
|
|
26
37
|
|
|
27
38
|
// src/private/toIntegerOrInfinity.ts
|
|
28
39
|
function toIntegerOrInfinity(value) {
|
|
@@ -32,8 +43,8 @@ function toIntegerOrInfinity(value) {
|
|
|
32
43
|
return ~~value;
|
|
33
44
|
}
|
|
34
45
|
|
|
35
|
-
// src/
|
|
36
|
-
function
|
|
46
|
+
// src/iteratorAt.ts
|
|
47
|
+
function iteratorAt(iterator, index) {
|
|
37
48
|
let currentIndex = 0;
|
|
38
49
|
index = toIntegerOrInfinity(index);
|
|
39
50
|
if (!isFinite(index)) {
|
|
@@ -42,7 +53,7 @@ function iterableAt(iterable, index) {
|
|
|
42
53
|
if (index < 0) {
|
|
43
54
|
throw new TypeError("index cannot be a negative finite number");
|
|
44
55
|
}
|
|
45
|
-
for (const value of
|
|
56
|
+
for (const value of iteratorToIterable(iterator)) {
|
|
46
57
|
if (currentIndex++ === index) {
|
|
47
58
|
return value;
|
|
48
59
|
}
|
|
@@ -51,6 +62,6 @@ function iterableAt(iterable, index) {
|
|
|
51
62
|
}
|
|
52
63
|
// Annotate the CommonJS export names for ESM import in node:
|
|
53
64
|
0 && (module.exports = {
|
|
54
|
-
|
|
65
|
+
iteratorAt
|
|
55
66
|
});
|
|
56
|
-
//# sourceMappingURL=iter-fest.
|
|
67
|
+
//# sourceMappingURL=iter-fest.iteratorAt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/iteratorAt.ts","../src/iteratorToIterable.ts","../src/private/toIntegerOrInfinity.ts"],"sourcesContent":["import { iteratorToIterable } from './iteratorToIterable';\nimport toIntegerOrInfinity from './private/toIntegerOrInfinity';\n\n/**\n * Returns the item located at the specified index.\n *\n * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.\n */\nexport function iteratorAt<T>(iterator: Iterator<T>, index: number): T | undefined {\n let currentIndex = 0;\n\n index = toIntegerOrInfinity(index);\n\n if (!isFinite(index)) {\n return;\n }\n\n if (index < 0) {\n throw new TypeError('index cannot be a negative finite number');\n }\n\n for (const value of iteratorToIterable(iterator)) {\n if (currentIndex++ === index) {\n return value;\n }\n }\n\n return undefined;\n}\n","export function iteratorToIterable<T>(iterator: Iterator<T>): IterableIterator<T> {\n const iterableIterator: IterableIterator<T> = {\n [Symbol.iterator]: () => iterableIterator,\n next: iterator.next.bind(iterator),\n ...(iterator.return ? { return: iterator.return.bind(iterator) } : {}),\n ...(iterator.throw ? { throw: iterator.throw.bind(iterator) } : {})\n };\n\n return iterableIterator;\n}\n","export default function toIntegerOrInfinity(value: number): number {\n if (value === Infinity || value === -Infinity) {\n return value;\n }\n\n return ~~value;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,SAAS,mBAAsB,UAA4C;AAChF,QAAM,mBAAwC;AAAA,IAC5C,CAAC,OAAO,QAAQ,GAAG,MAAM;AAAA,IACzB,MAAM,SAAS,KAAK,KAAK,QAAQ;AAAA,IACjC,GAAI,SAAS,SAAS,EAAE,QAAQ,SAAS,OAAO,KAAK,QAAQ,EAAE,IAAI,CAAC;AAAA,IACpE,GAAI,SAAS,QAAQ,EAAE,OAAO,SAAS,MAAM,KAAK,QAAQ,EAAE,IAAI,CAAC;AAAA,EACnE;AAEA,SAAO;AACT;;;ACTe,SAAR,oBAAqC,OAAuB;AACjE,MAAI,UAAU,YAAY,UAAU,WAAW;AAC7C,WAAO;AAAA,EACT;AAEA,SAAO,CAAC,CAAC;AACX;;;AFEO,SAAS,WAAc,UAAuB,OAA8B;AACjF,MAAI,eAAe;AAEnB,UAAQ,oBAAoB,KAAK;AAEjC,MAAI,CAAC,SAAS,KAAK,GAAG;AACpB;AAAA,EACF;AAEA,MAAI,QAAQ,GAAG;AACb,UAAM,IAAI,UAAU,0CAA0C;AAAA,EAChE;AAEA,aAAW,SAAS,mBAAmB,QAAQ,GAAG;AAChD,QAAI,mBAAmB,OAAO;AAC5B,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|