@sapphire/iterator-utilities 1.0.3-next.cd7e6b59 → 1.0.3-next.db356eb0

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.
Files changed (254) hide show
  1. package/dist/cjs/index.cjs +1 -1
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/cjs/lib/append.cjs +1 -1
  4. package/dist/cjs/lib/append.cjs.map +1 -1
  5. package/dist/cjs/lib/at.cjs +1 -1
  6. package/dist/cjs/lib/at.cjs.map +1 -1
  7. package/dist/cjs/lib/average.cjs +1 -1
  8. package/dist/cjs/lib/average.cjs.map +1 -1
  9. package/dist/cjs/lib/chain.cjs +1 -1
  10. package/dist/cjs/lib/chain.cjs.map +1 -1
  11. package/dist/cjs/lib/chunk.cjs +1 -1
  12. package/dist/cjs/lib/chunk.cjs.map +1 -1
  13. package/dist/cjs/lib/compact.cjs +1 -1
  14. package/dist/cjs/lib/compact.cjs.map +1 -1
  15. package/dist/cjs/lib/compress.cjs +1 -1
  16. package/dist/cjs/lib/compress.cjs.map +1 -1
  17. package/dist/cjs/lib/contains.cjs +2 -3
  18. package/dist/cjs/lib/contains.cjs.map +1 -1
  19. package/dist/cjs/lib/count.cjs +1 -1
  20. package/dist/cjs/lib/count.cjs.map +1 -1
  21. package/dist/cjs/lib/cycle.cjs +1 -1
  22. package/dist/cjs/lib/cycle.cjs.map +1 -1
  23. package/dist/cjs/lib/difference.cjs +1 -1
  24. package/dist/cjs/lib/difference.cjs.map +1 -1
  25. package/dist/cjs/lib/drop.cjs +4 -7
  26. package/dist/cjs/lib/drop.cjs.map +1 -1
  27. package/dist/cjs/lib/dropLast.cjs +2 -3
  28. package/dist/cjs/lib/dropLast.cjs.map +1 -1
  29. package/dist/cjs/lib/dropWhile.cjs +1 -1
  30. package/dist/cjs/lib/dropWhile.cjs.map +1 -1
  31. package/dist/cjs/lib/empty.cjs +1 -1
  32. package/dist/cjs/lib/empty.cjs.map +1 -1
  33. package/dist/cjs/lib/enumerate.cjs +1 -1
  34. package/dist/cjs/lib/enumerate.cjs.map +1 -1
  35. package/dist/cjs/lib/every.cjs +2 -3
  36. package/dist/cjs/lib/every.cjs.map +1 -1
  37. package/dist/cjs/lib/filter.cjs +2 -3
  38. package/dist/cjs/lib/filter.cjs.map +1 -1
  39. package/dist/cjs/lib/find.cjs +1 -1
  40. package/dist/cjs/lib/find.cjs.map +1 -1
  41. package/dist/cjs/lib/findIndex.cjs +1 -1
  42. package/dist/cjs/lib/findIndex.cjs.map +1 -1
  43. package/dist/cjs/lib/first.cjs +1 -1
  44. package/dist/cjs/lib/first.cjs.map +1 -1
  45. package/dist/cjs/lib/flat.cjs +1 -1
  46. package/dist/cjs/lib/flat.cjs.map +1 -1
  47. package/dist/cjs/lib/flatMap.cjs +1 -1
  48. package/dist/cjs/lib/flatMap.cjs.map +1 -1
  49. package/dist/cjs/lib/forEach.cjs +1 -1
  50. package/dist/cjs/lib/forEach.cjs.map +1 -1
  51. package/dist/cjs/lib/from.cjs +1 -1
  52. package/dist/cjs/lib/from.cjs.map +1 -1
  53. package/dist/cjs/lib/indexOf.cjs +1 -1
  54. package/dist/cjs/lib/indexOf.cjs.map +1 -1
  55. package/dist/cjs/lib/intersect.cjs +1 -1
  56. package/dist/cjs/lib/intersect.cjs.map +1 -1
  57. package/dist/cjs/lib/isEmpty.cjs +1 -1
  58. package/dist/cjs/lib/isEmpty.cjs.map +1 -1
  59. package/dist/cjs/lib/last.cjs +1 -1
  60. package/dist/cjs/lib/last.cjs.map +1 -1
  61. package/dist/cjs/lib/map.cjs +1 -1
  62. package/dist/cjs/lib/map.cjs.map +1 -1
  63. package/dist/cjs/lib/max.cjs +2 -3
  64. package/dist/cjs/lib/max.cjs.map +1 -1
  65. package/dist/cjs/lib/min.cjs +2 -3
  66. package/dist/cjs/lib/min.cjs.map +1 -1
  67. package/dist/cjs/lib/partition.cjs +1 -1
  68. package/dist/cjs/lib/partition.cjs.map +1 -1
  69. package/dist/cjs/lib/peekable.cjs +1 -1
  70. package/dist/cjs/lib/peekable.cjs.map +1 -1
  71. package/dist/cjs/lib/prepend.cjs +1 -1
  72. package/dist/cjs/lib/prepend.cjs.map +1 -1
  73. package/dist/cjs/lib/product.cjs +1 -1
  74. package/dist/cjs/lib/product.cjs.map +1 -1
  75. package/dist/cjs/lib/range.cjs +1 -1
  76. package/dist/cjs/lib/range.cjs.map +1 -1
  77. package/dist/cjs/lib/reduce.cjs +2 -3
  78. package/dist/cjs/lib/reduce.cjs.map +1 -1
  79. package/dist/cjs/lib/repeat.cjs +1 -1
  80. package/dist/cjs/lib/repeat.cjs.map +1 -1
  81. package/dist/cjs/lib/reverse.cjs +1 -1
  82. package/dist/cjs/lib/reverse.cjs.map +1 -1
  83. package/dist/cjs/lib/shared/_assertFunction.cjs +1 -1
  84. package/dist/cjs/lib/shared/_assertFunction.cjs.map +1 -1
  85. package/dist/cjs/lib/shared/_assertNotNegative.cjs +1 -1
  86. package/dist/cjs/lib/shared/_assertNotNegative.cjs.map +1 -1
  87. package/dist/cjs/lib/shared/_assertPositive.cjs +1 -1
  88. package/dist/cjs/lib/shared/_assertPositive.cjs.map +1 -1
  89. package/dist/cjs/lib/shared/_makeIterableIterator.cjs +1 -1
  90. package/dist/cjs/lib/shared/_makeIterableIterator.cjs.map +1 -1
  91. package/dist/cjs/lib/shared/_toIntegerOrInfinityOrThrow.cjs +4 -7
  92. package/dist/cjs/lib/shared/_toIntegerOrInfinityOrThrow.cjs.map +1 -1
  93. package/dist/cjs/lib/shared/_toIntegerOrThrow.cjs +4 -7
  94. package/dist/cjs/lib/shared/_toIntegerOrThrow.cjs.map +1 -1
  95. package/dist/cjs/lib/shared/_toNumberOrThrow.cjs +1 -1
  96. package/dist/cjs/lib/shared/_toNumberOrThrow.cjs.map +1 -1
  97. package/dist/cjs/lib/slice.cjs +2 -3
  98. package/dist/cjs/lib/slice.cjs.map +1 -1
  99. package/dist/cjs/lib/some.cjs +1 -1
  100. package/dist/cjs/lib/some.cjs.map +1 -1
  101. package/dist/cjs/lib/sorted.cjs +1 -1
  102. package/dist/cjs/lib/sorted.cjs.map +1 -1
  103. package/dist/cjs/lib/starMap.cjs +1 -1
  104. package/dist/cjs/lib/starMap.cjs.map +1 -1
  105. package/dist/cjs/lib/sum.cjs +1 -1
  106. package/dist/cjs/lib/sum.cjs.map +1 -1
  107. package/dist/cjs/lib/take.cjs +2 -3
  108. package/dist/cjs/lib/take.cjs.map +1 -1
  109. package/dist/cjs/lib/takeLast.cjs +3 -5
  110. package/dist/cjs/lib/takeLast.cjs.map +1 -1
  111. package/dist/cjs/lib/tee.cjs +2 -3
  112. package/dist/cjs/lib/tee.cjs.map +1 -1
  113. package/dist/cjs/lib/toArray.cjs +1 -1
  114. package/dist/cjs/lib/toArray.cjs.map +1 -1
  115. package/dist/cjs/lib/toIterableIterator.cjs +1 -1
  116. package/dist/cjs/lib/toIterableIterator.cjs.map +1 -1
  117. package/dist/cjs/lib/union.cjs +1 -1
  118. package/dist/cjs/lib/union.cjs.map +1 -1
  119. package/dist/cjs/lib/unique.cjs +1 -1
  120. package/dist/cjs/lib/unique.cjs.map +1 -1
  121. package/dist/cjs/lib/unzip.cjs +2 -3
  122. package/dist/cjs/lib/unzip.cjs.map +1 -1
  123. package/dist/cjs/lib/zip.cjs +2 -3
  124. package/dist/cjs/lib/zip.cjs.map +1 -1
  125. package/dist/esm/{chunk-G5GHKT7C.mjs → chunk-PAWJFY3S.mjs} +2 -2
  126. package/dist/esm/chunk-PAWJFY3S.mjs.map +1 -0
  127. package/dist/esm/index.mjs +1 -1
  128. package/dist/esm/index.mjs.map +1 -1
  129. package/dist/esm/lib/append.mjs +2 -2
  130. package/dist/esm/lib/append.mjs.map +1 -1
  131. package/dist/esm/lib/at.mjs +2 -2
  132. package/dist/esm/lib/at.mjs.map +1 -1
  133. package/dist/esm/lib/average.mjs +2 -2
  134. package/dist/esm/lib/average.mjs.map +1 -1
  135. package/dist/esm/lib/chain.mjs +2 -2
  136. package/dist/esm/lib/chain.mjs.map +1 -1
  137. package/dist/esm/lib/chunk.mjs +2 -2
  138. package/dist/esm/lib/chunk.mjs.map +1 -1
  139. package/dist/esm/lib/compact.mjs +2 -2
  140. package/dist/esm/lib/compact.mjs.map +1 -1
  141. package/dist/esm/lib/compress.mjs +2 -2
  142. package/dist/esm/lib/compress.mjs.map +1 -1
  143. package/dist/esm/lib/contains.mjs +3 -4
  144. package/dist/esm/lib/contains.mjs.map +1 -1
  145. package/dist/esm/lib/count.mjs +2 -2
  146. package/dist/esm/lib/count.mjs.map +1 -1
  147. package/dist/esm/lib/cycle.mjs +2 -2
  148. package/dist/esm/lib/cycle.mjs.map +1 -1
  149. package/dist/esm/lib/difference.mjs +2 -2
  150. package/dist/esm/lib/difference.mjs.map +1 -1
  151. package/dist/esm/lib/drop.mjs +5 -8
  152. package/dist/esm/lib/drop.mjs.map +1 -1
  153. package/dist/esm/lib/dropLast.mjs +3 -4
  154. package/dist/esm/lib/dropLast.mjs.map +1 -1
  155. package/dist/esm/lib/dropWhile.mjs +2 -2
  156. package/dist/esm/lib/dropWhile.mjs.map +1 -1
  157. package/dist/esm/lib/empty.mjs +2 -2
  158. package/dist/esm/lib/empty.mjs.map +1 -1
  159. package/dist/esm/lib/enumerate.mjs +2 -2
  160. package/dist/esm/lib/enumerate.mjs.map +1 -1
  161. package/dist/esm/lib/every.mjs +3 -4
  162. package/dist/esm/lib/every.mjs.map +1 -1
  163. package/dist/esm/lib/filter.mjs +3 -4
  164. package/dist/esm/lib/filter.mjs.map +1 -1
  165. package/dist/esm/lib/find.mjs +2 -2
  166. package/dist/esm/lib/find.mjs.map +1 -1
  167. package/dist/esm/lib/findIndex.mjs +2 -2
  168. package/dist/esm/lib/findIndex.mjs.map +1 -1
  169. package/dist/esm/lib/first.mjs +2 -2
  170. package/dist/esm/lib/first.mjs.map +1 -1
  171. package/dist/esm/lib/flat.mjs +2 -2
  172. package/dist/esm/lib/flat.mjs.map +1 -1
  173. package/dist/esm/lib/flatMap.mjs +2 -2
  174. package/dist/esm/lib/flatMap.mjs.map +1 -1
  175. package/dist/esm/lib/forEach.mjs +2 -2
  176. package/dist/esm/lib/forEach.mjs.map +1 -1
  177. package/dist/esm/lib/from.mjs +2 -2
  178. package/dist/esm/lib/from.mjs.map +1 -1
  179. package/dist/esm/lib/indexOf.mjs +2 -2
  180. package/dist/esm/lib/indexOf.mjs.map +1 -1
  181. package/dist/esm/lib/intersect.mjs +2 -2
  182. package/dist/esm/lib/intersect.mjs.map +1 -1
  183. package/dist/esm/lib/isEmpty.mjs +2 -2
  184. package/dist/esm/lib/isEmpty.mjs.map +1 -1
  185. package/dist/esm/lib/last.mjs +2 -2
  186. package/dist/esm/lib/last.mjs.map +1 -1
  187. package/dist/esm/lib/map.mjs +2 -2
  188. package/dist/esm/lib/map.mjs.map +1 -1
  189. package/dist/esm/lib/max.mjs +3 -4
  190. package/dist/esm/lib/max.mjs.map +1 -1
  191. package/dist/esm/lib/min.mjs +3 -4
  192. package/dist/esm/lib/min.mjs.map +1 -1
  193. package/dist/esm/lib/partition.mjs +2 -2
  194. package/dist/esm/lib/partition.mjs.map +1 -1
  195. package/dist/esm/lib/peekable.mjs +2 -2
  196. package/dist/esm/lib/peekable.mjs.map +1 -1
  197. package/dist/esm/lib/prepend.mjs +2 -2
  198. package/dist/esm/lib/prepend.mjs.map +1 -1
  199. package/dist/esm/lib/product.mjs +2 -2
  200. package/dist/esm/lib/product.mjs.map +1 -1
  201. package/dist/esm/lib/range.mjs +2 -2
  202. package/dist/esm/lib/range.mjs.map +1 -1
  203. package/dist/esm/lib/reduce.mjs +3 -4
  204. package/dist/esm/lib/reduce.mjs.map +1 -1
  205. package/dist/esm/lib/repeat.mjs +2 -2
  206. package/dist/esm/lib/repeat.mjs.map +1 -1
  207. package/dist/esm/lib/reverse.mjs +2 -2
  208. package/dist/esm/lib/reverse.mjs.map +1 -1
  209. package/dist/esm/lib/shared/_assertFunction.mjs +2 -2
  210. package/dist/esm/lib/shared/_assertFunction.mjs.map +1 -1
  211. package/dist/esm/lib/shared/_assertNotNegative.mjs +2 -2
  212. package/dist/esm/lib/shared/_assertNotNegative.mjs.map +1 -1
  213. package/dist/esm/lib/shared/_assertPositive.mjs +2 -2
  214. package/dist/esm/lib/shared/_assertPositive.mjs.map +1 -1
  215. package/dist/esm/lib/shared/_makeIterableIterator.mjs +2 -2
  216. package/dist/esm/lib/shared/_makeIterableIterator.mjs.map +1 -1
  217. package/dist/esm/lib/shared/_toIntegerOrInfinityOrThrow.mjs +5 -8
  218. package/dist/esm/lib/shared/_toIntegerOrInfinityOrThrow.mjs.map +1 -1
  219. package/dist/esm/lib/shared/_toIntegerOrThrow.mjs +5 -8
  220. package/dist/esm/lib/shared/_toIntegerOrThrow.mjs.map +1 -1
  221. package/dist/esm/lib/shared/_toNumberOrThrow.mjs +2 -2
  222. package/dist/esm/lib/shared/_toNumberOrThrow.mjs.map +1 -1
  223. package/dist/esm/lib/slice.mjs +3 -4
  224. package/dist/esm/lib/slice.mjs.map +1 -1
  225. package/dist/esm/lib/some.mjs +2 -2
  226. package/dist/esm/lib/some.mjs.map +1 -1
  227. package/dist/esm/lib/sorted.mjs +2 -2
  228. package/dist/esm/lib/sorted.mjs.map +1 -1
  229. package/dist/esm/lib/starMap.mjs +2 -2
  230. package/dist/esm/lib/starMap.mjs.map +1 -1
  231. package/dist/esm/lib/sum.mjs +2 -2
  232. package/dist/esm/lib/sum.mjs.map +1 -1
  233. package/dist/esm/lib/take.mjs +3 -4
  234. package/dist/esm/lib/take.mjs.map +1 -1
  235. package/dist/esm/lib/takeLast.mjs +4 -6
  236. package/dist/esm/lib/takeLast.mjs.map +1 -1
  237. package/dist/esm/lib/tee.mjs +3 -4
  238. package/dist/esm/lib/tee.mjs.map +1 -1
  239. package/dist/esm/lib/toArray.mjs +2 -2
  240. package/dist/esm/lib/toArray.mjs.map +1 -1
  241. package/dist/esm/lib/toIterableIterator.mjs +2 -2
  242. package/dist/esm/lib/toIterableIterator.mjs.map +1 -1
  243. package/dist/esm/lib/union.mjs +2 -2
  244. package/dist/esm/lib/union.mjs.map +1 -1
  245. package/dist/esm/lib/unique.mjs +2 -2
  246. package/dist/esm/lib/unique.mjs.map +1 -1
  247. package/dist/esm/lib/unzip.mjs +3 -4
  248. package/dist/esm/lib/unzip.mjs.map +1 -1
  249. package/dist/esm/lib/zip.mjs +3 -4
  250. package/dist/esm/lib/zip.mjs.map +1 -1
  251. package/dist/iife/index.global.js +24 -47
  252. package/dist/iife/index.global.js.map +1 -1
  253. package/package.json +9 -9
  254. package/dist/esm/chunk-G5GHKT7C.mjs.map +0 -1
@@ -381,5 +381,5 @@ Object.keys(zip_cjs).forEach(function (k) {
381
381
  get: function () { return zip_cjs[k]; }
382
382
  });
383
383
  });
384
- //# sourceMappingURL=out.js.map
384
+ //# sourceMappingURL=index.cjs.map
385
385
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","sourcesContent":["export * from './lib/append';\nexport * from './lib/at';\nexport * from './lib/average';\nexport * from './lib/chain';\nexport * from './lib/chunk';\nexport * from './lib/compact';\nexport * from './lib/compress';\nexport * from './lib/contains';\nexport * from './lib/count';\nexport * from './lib/cycle';\nexport * from './lib/difference';\nexport * from './lib/drop';\nexport * from './lib/dropLast';\nexport * from './lib/dropWhile';\nexport * from './lib/empty';\nexport * from './lib/enumerate';\nexport * from './lib/every';\nexport * from './lib/filter';\nexport * from './lib/find';\nexport * from './lib/findIndex';\nexport * from './lib/first';\nexport * from './lib/flat';\nexport * from './lib/flatMap';\nexport * from './lib/forEach';\nexport * from './lib/from';\nexport * from './lib/indexOf';\nexport * from './lib/intersect';\nexport * from './lib/isEmpty';\nexport * from './lib/last';\nexport * from './lib/map';\nexport * from './lib/max';\nexport * from './lib/min';\nexport * from './lib/partition';\nexport * from './lib/peekable';\nexport * from './lib/prepend';\nexport * from './lib/product';\nexport * from './lib/range';\nexport * from './lib/reduce';\nexport * from './lib/repeat';\nexport * from './lib/reverse';\nexport type { NumberResolvable } from './lib/shared/_toNumberOrThrow';\nexport * from './lib/slice';\nexport * from './lib/some';\nexport * from './lib/sorted';\nexport * from './lib/starMap';\nexport * from './lib/sum';\nexport * from './lib/take';\nexport * from './lib/takeLast';\nexport * from './lib/tee';\nexport * from './lib/toArray';\nexport * from './lib/toIterableIterator';\nexport * from './lib/union';\nexport * from './lib/unique';\nexport * from './lib/unzip';\nexport * from './lib/zip';\n"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs","sourcesContent":[]}
@@ -11,5 +11,5 @@ __name(append, "append");
11
11
 
12
12
  exports.append = append;
13
13
  exports.concat = append;
14
- //# sourceMappingURL=out.js.map
14
+ //# sourceMappingURL=append.cjs.map
15
15
  //# sourceMappingURL=append.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/append.ts"],"names":[],"mappings":";;;;AAAA,SAAS,aAAa;AAmBf,SAAS,OACf,aACG,WAC6B;AAChC,SAAO,MAAM,UAAU,GAAG,SAAS;AACpC;AALgB","sourcesContent":["import { chain } from './chain';\nimport type { IterableResolvable } from './from';\n\n/**\n * Appends iterables to the end of the first iterable, returning a new iterable combining all of them. It's similar to concatenating arrays or doing `[...a, ...b, ...c]`.\n *\n * @param iterable The iterator to append values to.\n * @param iterables The iterables to append to the iterator.\n * @returns An iterator that yields the values of the provided iterator followed by the values of the provided iterables.\n *\n * @example\n * ```typescript\n * import { append } from '@sapphire/iterator-utilities';\n *\n * const iterable = append([1, 2, 3], [4, 5, 6], [7, 8, 9]);\n * console.log([...iterable]);\n * // Output: [1, 2, 3, 4, 5, 6, 7, 8, 9]\n * ```\n */\nexport function append<const ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\t...iterables: IterableResolvable<ElementType>[]\n): IterableIterator<ElementType> {\n\treturn chain(iterable, ...iterables);\n}\n\nexport { append as concat };\n"]}
1
+ {"version":3,"sources":["../../../src/lib/append.ts"],"names":["chain"],"mappings":";;;;;;AAmBO,SAAS,MAAA,CACf,aACG,SAC6B,EAAA;AAChC,EAAO,OAAAA,eAAA,CAAM,QAAU,EAAA,GAAG,SAAS,CAAA,CAAA;AACpC,CAAA;AALgB,MAAA,CAAA,MAAA,EAAA,QAAA,CAAA","file":"append.cjs","sourcesContent":["import { chain } from './chain';\nimport type { IterableResolvable } from './from';\n\n/**\n * Appends iterables to the end of the first iterable, returning a new iterable combining all of them. It's similar to concatenating arrays or doing `[...a, ...b, ...c]`.\n *\n * @param iterable The iterator to append values to.\n * @param iterables The iterables to append to the iterator.\n * @returns An iterator that yields the values of the provided iterator followed by the values of the provided iterables.\n *\n * @example\n * ```typescript\n * import { append } from '@sapphire/iterator-utilities';\n *\n * const iterable = append([1, 2, 3], [4, 5, 6], [7, 8, 9]);\n * console.log([...iterable]);\n * // Output: [1, 2, 3, 4, 5, 6, 7, 8, 9]\n * ```\n */\nexport function append<const ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\t...iterables: IterableResolvable<ElementType>[]\n): IterableIterator<ElementType> {\n\treturn chain(iterable, ...iterables);\n}\n\nexport { append as concat };\n"]}
@@ -14,5 +14,5 @@ function at(iterable, index) {
14
14
  __name(at, "at");
15
15
 
16
16
  exports.at = at;
17
- //# sourceMappingURL=out.js.map
17
+ //# sourceMappingURL=at.cjs.map
18
18
  //# sourceMappingURL=at.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/at.ts"],"names":[],"mappings":";;;;AAAA,SAAS,YAAY;AACrB,SAAS,aAAa;AAEtB,SAAS,yBAAyB;AAClC,SAAS,kCAAkC;AAsBpC,SAAS,GAAsB,UAA2C,OAAwC;AACxH,UAAQ,kBAAkB,2BAA2B,KAAK,GAAG,KAAK;AAClE,SAAO,MAAM,UAAU,IAAI,WAAW,KAAK,UAAU,KAAK,CAAC;AAC5D;AAHgB","sourcesContent":["import { drop } from './drop';\nimport { first } from './first';\nimport type { IterableResolvable } from './from';\nimport { assertNotNegative } from './shared/_assertNotNegative';\nimport { toIntegerOrInfinityOrThrow } from './shared/_toIntegerOrInfinityOrThrow';\n\n/**\n * Advances the iterable to the `n`th element and returns it. If the iterable is exhausted before reaching the `n`th element, it returns `undefined`.\n *\n * @param iterable An iterator to return an element from.\n * @param index The index of the element to retrieve.\n * @returns The element at the specified index, or `undefined` if the index is out of range.\n *\n * @example\n * ```typescript\n * import { at } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3, 4, 5];\n * console.log(at(iterable, 2));\n * // Output: 3\n * ```\n *\n * @remarks\n *\n * This function consumes the input iterator up to the specified index.\n */\nexport function at<const ElementType>(iterable: IterableResolvable<ElementType>, index: number): ElementType | undefined {\n\tindex = assertNotNegative(toIntegerOrInfinityOrThrow(index), index);\n\treturn first(index === 0 ? iterable : drop(iterable, index));\n}\n"]}
1
+ {"version":3,"sources":["../../../src/lib/at.ts"],"names":["assertNotNegative","toIntegerOrInfinityOrThrow","first","drop"],"mappings":";;;;;;;;;AA0BO,SAAS,EAAA,CAAsB,UAA2C,KAAwC,EAAA;AACxH,EAAA,KAAA,GAAQA,wCAAkB,CAAAC,0DAAA,CAA2B,KAAK,CAAA,EAAG,KAAK,CAAA,CAAA;AAClE,EAAA,OAAOC,gBAAM,KAAU,KAAA,CAAA,GAAI,WAAWC,aAAK,CAAA,QAAA,EAAU,KAAK,CAAC,CAAA,CAAA;AAC5D,CAAA;AAHgB,MAAA,CAAA,EAAA,EAAA,IAAA,CAAA","file":"at.cjs","sourcesContent":["import { drop } from './drop';\nimport { first } from './first';\nimport type { IterableResolvable } from './from';\nimport { assertNotNegative } from './shared/_assertNotNegative';\nimport { toIntegerOrInfinityOrThrow } from './shared/_toIntegerOrInfinityOrThrow';\n\n/**\n * Advances the iterable to the `n`th element and returns it. If the iterable is exhausted before reaching the `n`th element, it returns `undefined`.\n *\n * @param iterable An iterator to return an element from.\n * @param index The index of the element to retrieve.\n * @returns The element at the specified index, or `undefined` if the index is out of range.\n *\n * @example\n * ```typescript\n * import { at } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3, 4, 5];\n * console.log(at(iterable, 2));\n * // Output: 3\n * ```\n *\n * @remarks\n *\n * This function consumes the input iterator up to the specified index.\n */\nexport function at<const ElementType>(iterable: IterableResolvable<ElementType>, index: number): ElementType | undefined {\n\tindex = assertNotNegative(toIntegerOrInfinityOrThrow(index), index);\n\treturn first(index === 0 ? iterable : drop(iterable, index));\n}\n"]}
@@ -17,5 +17,5 @@ function average(iterable) {
17
17
  __name(average, "average");
18
18
 
19
19
  exports.average = average;
20
- //# sourceMappingURL=out.js.map
20
+ //# sourceMappingURL=average.cjs.map
21
21
  //# sourceMappingURL=average.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/average.ts"],"names":[],"mappings":";;;;AACA,SAAS,WAAW;AACpB,SAAS,uBAA8C;AAqBhD,SAAS,QAAQ,UAA+D;AACtF,MAAI,MAAM;AACV,MAAI,QAAQ;AACZ,aAAW,SAAS,IAAI,UAAU,eAAe,GAAG;AACnD,WAAO;AACP;AAAA,EACD;AAEA,SAAO,UAAU,IAAI,OAAO,MAAM;AACnC;AATgB","sourcesContent":["import type { IterableResolvable } from './from';\nimport { map } from './map';\nimport { toNumberOrThrow, type NumberResolvable } from './shared/_toNumberOrThrow';\n\n/**\n * Consumes the iterable and returns the average value of all the elements. If the iterable is empty, it returns `null`.\n *\n * @param iterable The iterator to calculate the average of.\n * @returns The average of the sequence of numbers, or `null` if the sequence is empty or contains only non-number values.\n *\n * @example\n * ```typescript\n * import { average } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3, 4, 5];\n * console.log(average(iterable));\n * // Output: 3\n * ```\n *\n * @remarks\n *\n * This function consumes the entire iterator.\n */\nexport function average(iterable: IterableResolvable<NumberResolvable>): number | null {\n\tlet sum = 0;\n\tlet total = 0;\n\tfor (const value of map(iterable, toNumberOrThrow)) {\n\t\tsum += value;\n\t\ttotal++;\n\t}\n\n\treturn total === 0 ? null : sum / total;\n}\n"]}
1
+ {"version":3,"sources":["../../../src/lib/average.ts"],"names":["map","toNumberOrThrow"],"mappings":";;;;;;;AAuBO,SAAS,QAAQ,QAA+D,EAAA;AACtF,EAAA,IAAI,GAAM,GAAA,CAAA,CAAA;AACV,EAAA,IAAI,KAAQ,GAAA,CAAA,CAAA;AACZ,EAAA,KAAA,MAAW,KAAS,IAAAA,WAAA,CAAI,QAAU,EAAAC,oCAAe,CAAG,EAAA;AACnD,IAAO,GAAA,IAAA,KAAA,CAAA;AACP,IAAA,KAAA,EAAA,CAAA;AAAA,GACD;AAEA,EAAO,OAAA,KAAA,KAAU,CAAI,GAAA,IAAA,GAAO,GAAM,GAAA,KAAA,CAAA;AACnC,CAAA;AATgB,MAAA,CAAA,OAAA,EAAA,SAAA,CAAA","file":"average.cjs","sourcesContent":["import type { IterableResolvable } from './from';\nimport { map } from './map';\nimport { toNumberOrThrow, type NumberResolvable } from './shared/_toNumberOrThrow';\n\n/**\n * Consumes the iterable and returns the average value of all the elements. If the iterable is empty, it returns `null`.\n *\n * @param iterable The iterator to calculate the average of.\n * @returns The average of the sequence of numbers, or `null` if the sequence is empty or contains only non-number values.\n *\n * @example\n * ```typescript\n * import { average } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3, 4, 5];\n * console.log(average(iterable));\n * // Output: 3\n * ```\n *\n * @remarks\n *\n * This function consumes the entire iterator.\n */\nexport function average(iterable: IterableResolvable<NumberResolvable>): number | null {\n\tlet sum = 0;\n\tlet total = 0;\n\tfor (const value of map(iterable, toNumberOrThrow)) {\n\t\tsum += value;\n\t\ttotal++;\n\t}\n\n\treturn total === 0 ? null : sum / total;\n}\n"]}
@@ -12,5 +12,5 @@ function* chain(...iterables) {
12
12
  __name(chain, "chain");
13
13
 
14
14
  exports.chain = chain;
15
- //# sourceMappingURL=out.js.map
15
+ //# sourceMappingURL=chain.cjs.map
16
16
  //# sourceMappingURL=chain.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/chain.ts"],"names":[],"mappings":";;;;AACA,SAAS,0BAA0B;AAiB5B,UAAU,SAA4B,WAA6E;AACzH,aAAW,YAAY,WAAW;AACjC,WAAO,mBAAmB,QAAQ;AAAA,EACnC;AACD;AAJiB","sourcesContent":["import type { IterableResolvable } from './from';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Similar to `append`, but takes an iterable of iterables and chains them together.\n *\n * @param iterables The iterators to chain together.\n * @returns An iterator that yields the values of the provided iterators in order.\n *\n * @example\n * ```typescript\n * import { chain } from '@sapphire/iterator-utilities';\n *\n * const iterable = chain([1, 2, 3], [4, 5, 6], [7, 8, 9]);\n * console.log([...iterable]);\n * // Output: [1, 2, 3, 4, 5, 6, 7, 8, 9]\n * ```\n */\nexport function* chain<const ElementType>(...iterables: IterableResolvable<ElementType>[]): IterableIterator<ElementType> {\n\tfor (const iterable of iterables) {\n\t\tyield* toIterableIterator(iterable);\n\t}\n}\n"]}
1
+ {"version":3,"sources":["../../../src/lib/chain.ts"],"names":["toIterableIterator"],"mappings":";;;;;;AAkBO,UAAU,SAA4B,SAA6E,EAAA;AACzH,EAAA,KAAA,MAAW,YAAY,SAAW,EAAA;AACjC,IAAA,OAAOA,0CAAmB,QAAQ,CAAA,CAAA;AAAA,GACnC;AACD,CAAA;AAJiB,MAAA,CAAA,KAAA,EAAA,OAAA,CAAA","file":"chain.cjs","sourcesContent":["import type { IterableResolvable } from './from';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Similar to `append`, but takes an iterable of iterables and chains them together.\n *\n * @param iterables The iterators to chain together.\n * @returns An iterator that yields the values of the provided iterators in order.\n *\n * @example\n * ```typescript\n * import { chain } from '@sapphire/iterator-utilities';\n *\n * const iterable = chain([1, 2, 3], [4, 5, 6], [7, 8, 9]);\n * console.log([...iterable]);\n * // Output: [1, 2, 3, 4, 5, 6, 7, 8, 9]\n * ```\n */\nexport function* chain<const ElementType>(...iterables: IterableResolvable<ElementType>[]): IterableIterator<ElementType> {\n\tfor (const iterable of iterables) {\n\t\tyield* toIterableIterator(iterable);\n\t}\n}\n"]}
@@ -23,5 +23,5 @@ function* chunk(iterable, size) {
23
23
  __name(chunk, "chunk");
24
24
 
25
25
  exports.chunk = chunk;
26
- //# sourceMappingURL=out.js.map
26
+ //# sourceMappingURL=chunk.cjs.map
27
27
  //# sourceMappingURL=chunk.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/chunk.ts"],"names":[],"mappings":";;;;AACA,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AAiB5B,UAAU,MAAyB,UAA2C,MAA+C;AACnI,SAAO,eAAe,iBAAiB,IAAI,GAAG,IAAI;AAElD,MAAI,SAAwB,CAAC;AAC7B,aAAW,WAAW,mBAAmB,QAAQ,GAAG;AACnD,WAAO,KAAK,OAAO;AAEnB,QAAI,OAAO,WAAW,MAAM;AAC3B,YAAM;AACN,eAAS,CAAC;AAAA,IACX;AAAA,EACD;AAEA,MAAI,OAAO,QAAQ;AAClB,UAAM;AAAA,EACP;AACD;AAhBiB","sourcesContent":["import type { IterableResolvable } from './from';\nimport { assertPositive } from './shared/_assertPositive';\nimport { toIntegerOrThrow } from './shared/_toIntegerOrThrow';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Chunks the iterable into arrays of at most `size` elements.\n *\n * @param iterable The iterator whose elements to chunk.\n * @param size The maximum size of each chunk.\n *\n * @example\n * ```typescript\n * import { chunk } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3, 4, 5];\n * console.log([...chunk(iterable, 2)]);\n * // Output: [[1, 2], [3, 4], [5]]\n * ```\n */\nexport function* chunk<const ElementType>(iterable: IterableResolvable<ElementType>, size: number): IterableIterator<ElementType[]> {\n\tsize = assertPositive(toIntegerOrThrow(size), size);\n\n\tlet buffer: ElementType[] = [];\n\tfor (const element of toIterableIterator(iterable)) {\n\t\tbuffer.push(element);\n\n\t\tif (buffer.length === size) {\n\t\t\tyield buffer;\n\t\t\tbuffer = [];\n\t\t}\n\t}\n\n\tif (buffer.length) {\n\t\tyield buffer;\n\t}\n}\n"]}
1
+ {"version":3,"sources":["../../../src/lib/chunk.ts"],"names":["assertPositive","toIntegerOrThrow","toIterableIterator"],"mappings":";;;;;;;;AAoBO,UAAU,KAAA,CAAyB,UAA2C,IAA+C,EAAA;AACnI,EAAA,IAAA,GAAOA,kCAAe,CAAAC,sCAAA,CAAiB,IAAI,CAAA,EAAG,IAAI,CAAA,CAAA;AAElD,EAAA,IAAI,SAAwB,EAAC,CAAA;AAC7B,EAAW,KAAA,MAAA,OAAA,IAAWC,yCAAmB,CAAA,QAAQ,CAAG,EAAA;AACnD,IAAA,MAAA,CAAO,KAAK,OAAO,CAAA,CAAA;AAEnB,IAAI,IAAA,MAAA,CAAO,WAAW,IAAM,EAAA;AAC3B,MAAM,MAAA,MAAA,CAAA;AACN,MAAA,MAAA,GAAS,EAAC,CAAA;AAAA,KACX;AAAA,GACD;AAEA,EAAA,IAAI,OAAO,MAAQ,EAAA;AAClB,IAAM,MAAA,MAAA,CAAA;AAAA,GACP;AACD,CAAA;AAhBiB,MAAA,CAAA,KAAA,EAAA,OAAA,CAAA","file":"chunk.cjs","sourcesContent":["import type { IterableResolvable } from './from';\nimport { assertPositive } from './shared/_assertPositive';\nimport { toIntegerOrThrow } from './shared/_toIntegerOrThrow';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Chunks the iterable into arrays of at most `size` elements.\n *\n * @param iterable The iterator whose elements to chunk.\n * @param size The maximum size of each chunk.\n *\n * @example\n * ```typescript\n * import { chunk } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3, 4, 5];\n * console.log([...chunk(iterable, 2)]);\n * // Output: [[1, 2], [3, 4], [5]]\n * ```\n */\nexport function* chunk<const ElementType>(iterable: IterableResolvable<ElementType>, size: number): IterableIterator<ElementType[]> {\n\tsize = assertPositive(toIntegerOrThrow(size), size);\n\n\tlet buffer: ElementType[] = [];\n\tfor (const element of toIterableIterator(iterable)) {\n\t\tbuffer.push(element);\n\n\t\tif (buffer.length === size) {\n\t\t\tyield buffer;\n\t\t\tbuffer = [];\n\t\t}\n\t}\n\n\tif (buffer.length) {\n\t\tyield buffer;\n\t}\n}\n"]}
@@ -10,5 +10,5 @@ function compact(iterable) {
10
10
  __name(compact, "compact");
11
11
 
12
12
  exports.compact = compact;
13
- //# sourceMappingURL=out.js.map
13
+ //# sourceMappingURL=compact.cjs.map
14
14
  //# sourceMappingURL=compact.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/compact.ts"],"names":[],"mappings":";;;;AAAA,SAAS,cAAc;AAiBhB,SAAS,QAA2B,UAA6F;AACvI,SAAO,OAAO,UAAU,CAAC,UAAgC,UAAU,QAAQ,UAAU,MAAS;AAC/F;AAFgB","sourcesContent":["import { filter } from './filter';\nimport type { IterableResolvable } from './from';\n\n/**\n * Creates a new iterable that yields all the non-nullish values (`null` and `undefined`) from the iterable.\n *\n * @param iterable An iterator that contains elements to be compacted.\n *\n * @example\n * ```typescript\n * import { compact } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, null, 2, undefined, 3];\n * console.log([...compact(iterable)]);\n * // Output: [1, 2, 3]\n * ```\n */\nexport function compact<const ElementType>(iterable: IterableResolvable<ElementType | null | undefined>): IterableIterator<ElementType> {\n\treturn filter(iterable, (value): value is ElementType => value !== null && value !== undefined);\n}\n"]}
1
+ {"version":3,"sources":["../../../src/lib/compact.ts"],"names":["filter"],"mappings":";;;;;;AAiBO,SAAS,QAA2B,QAA6F,EAAA;AACvI,EAAA,OAAOA,kBAAO,QAAU,EAAA,CAAC,UAAgC,KAAU,KAAA,IAAA,IAAQ,UAAU,KAAS,CAAA,CAAA,CAAA;AAC/F,CAAA;AAFgB,MAAA,CAAA,OAAA,EAAA,SAAA,CAAA","file":"compact.cjs","sourcesContent":["import { filter } from './filter';\nimport type { IterableResolvable } from './from';\n\n/**\n * Creates a new iterable that yields all the non-nullish values (`null` and `undefined`) from the iterable.\n *\n * @param iterable An iterator that contains elements to be compacted.\n *\n * @example\n * ```typescript\n * import { compact } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, null, 2, undefined, 3];\n * console.log([...compact(iterable)]);\n * // Output: [1, 2, 3]\n * ```\n */\nexport function compact<const ElementType>(iterable: IterableResolvable<ElementType | null | undefined>): IterableIterator<ElementType> {\n\treturn filter(iterable, (value): value is ElementType => value !== null && value !== undefined);\n}\n"]}
@@ -20,5 +20,5 @@ function* compress(iterable, selectors) {
20
20
  __name(compress, "compress");
21
21
 
22
22
  exports.compress = compress;
23
- //# sourceMappingURL=out.js.map
23
+ //# sourceMappingURL=compress.cjs.map
24
24
  //# sourceMappingURL=compress.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/compress.ts"],"names":[],"mappings":";;;;AAAA,SAAS,YAAqC;AAC9C,SAAS,0BAA0B;AAuB5B,UAAU,SAChB,UACA,WACgC;AAChC,QAAM,oBAAoB,KAAK,SAAS;AACxC,aAAW,0BAA0B,mBAAmB,QAAQ,GAAG;AAClE,UAAM,iBAAiB,kBAAkB,KAAK;AAC9C,QAAI,eAAe,MAAM;AACxB;AAAA,IACD;AAEA,QAAI,eAAe,OAAO;AACzB,YAAM;AAAA,IACP;AAAA,EACD;AACD;AAfiB","sourcesContent":["import { from, type IterableResolvable } from './from';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Creates a new iterable of the first iterable based on the truthiness of the corresponding element in the second iterable.\n *\n * @param iterable An iterator that contains elements to be compressed.\n * @param selectors The selectors that determine which elements to include in the result.\n * @returns An iterator that contains only the elements from the input iterator that correspond to `true` values in the\n * selectors iterator.\n *\n * @example\n * ```typescript\n * import { compress } from '@sapphire/iterator-utilities';\n *\n * const iterable = compress([1, 2, 3, 4, 5], [true, false, true, false, true]);\n * console.log([...iterable]);\n * // Output: [1, 3, 5]\n * ```\n *\n * @remarks\n *\n * This function consumes both input iterators until either is exhausted.\n */\nexport function* compress<const ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tselectors: IterableResolvable<boolean>\n): IterableIterator<ElementType> {\n\tconst resolvedSelectors = from(selectors);\n\tfor (const resolvedIterableResult of toIterableIterator(iterable)) {\n\t\tconst selectorResult = resolvedSelectors.next();\n\t\tif (selectorResult.done) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (selectorResult.value) {\n\t\t\tyield resolvedIterableResult;\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"sources":["../../../src/lib/compress.ts"],"names":["from","toIterableIterator"],"mappings":";;;;;;;AAwBO,UAAU,QAAA,CAChB,UACA,SACgC,EAAA;AAChC,EAAM,MAAA,iBAAA,GAAoBA,cAAK,SAAS,CAAA,CAAA;AACxC,EAAW,KAAA,MAAA,sBAAA,IAA0BC,yCAAmB,CAAA,QAAQ,CAAG,EAAA;AAClE,IAAM,MAAA,cAAA,GAAiB,kBAAkB,IAAK,EAAA,CAAA;AAC9C,IAAA,IAAI,eAAe,IAAM,EAAA;AACxB,MAAA,OAAA;AAAA,KACD;AAEA,IAAA,IAAI,eAAe,KAAO,EAAA;AACzB,MAAM,MAAA,sBAAA,CAAA;AAAA,KACP;AAAA,GACD;AACD,CAAA;AAfiB,MAAA,CAAA,QAAA,EAAA,UAAA,CAAA","file":"compress.cjs","sourcesContent":["import { from, type IterableResolvable } from './from';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Creates a new iterable of the first iterable based on the truthiness of the corresponding element in the second iterable.\n *\n * @param iterable An iterator that contains elements to be compressed.\n * @param selectors The selectors that determine which elements to include in the result.\n * @returns An iterator that contains only the elements from the input iterator that correspond to `true` values in the\n * selectors iterator.\n *\n * @example\n * ```typescript\n * import { compress } from '@sapphire/iterator-utilities';\n *\n * const iterable = compress([1, 2, 3, 4, 5], [true, false, true, false, true]);\n * console.log([...iterable]);\n * // Output: [1, 3, 5]\n * ```\n *\n * @remarks\n *\n * This function consumes both input iterators until either is exhausted.\n */\nexport function* compress<const ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tselectors: IterableResolvable<boolean>\n): IterableIterator<ElementType> {\n\tconst resolvedSelectors = from(selectors);\n\tfor (const resolvedIterableResult of toIterableIterator(iterable)) {\n\t\tconst selectorResult = resolvedSelectors.next();\n\t\tif (selectorResult.done) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (selectorResult.value) {\n\t\t\tyield resolvedIterableResult;\n\t\t}\n\t}\n}\n"]}
@@ -6,13 +6,12 @@ var __defProp = Object.defineProperty;
6
6
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
7
  function contains(iterable, value) {
8
8
  for (const element of toIterableIterator_cjs.toIterableIterator(iterable)) {
9
- if (element === value)
10
- return true;
9
+ if (element === value) return true;
11
10
  }
12
11
  return false;
13
12
  }
14
13
  __name(contains, "contains");
15
14
 
16
15
  exports.contains = contains;
17
- //# sourceMappingURL=out.js.map
16
+ //# sourceMappingURL=contains.cjs.map
18
17
  //# sourceMappingURL=contains.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/contains.ts"],"names":[],"mappings":";;;;AACA,SAAS,0BAA0B;AAsB5B,SAAS,SAA4B,UAA2C,OAA6B;AACnH,aAAW,WAAW,mBAAmB,QAAQ,GAAG;AACnD,QAAI,YAAY;AAAO,aAAO;AAAA,EAC/B;AAEA,SAAO;AACR;AANgB","sourcesContent":["import type { IterableResolvable } from './from';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Advances the iterable until it finds the element, returning `true` if it's found and `false` otherwise.\n *\n * @param iterable The iterator in which to locate a value.\n * @param value The value to locate in the iterator.\n * @returns `true` if the value is found in the iterator; otherwise, `false`.\n *\n * @example\n * ```typescript\n * import { contains } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3, 4, 5];\n * console.log(contains(iterable, 3));\n * // Output: true\n * ```\n *\n * @remarks\n *\n * This function consumes the iterator until the value is found or the iterator is exhausted.\n */\nexport function contains<const ElementType>(iterable: IterableResolvable<ElementType>, value: ElementType): boolean {\n\tfor (const element of toIterableIterator(iterable)) {\n\t\tif (element === value) return true;\n\t}\n\n\treturn false;\n}\n"]}
1
+ {"version":3,"sources":["../../../src/lib/contains.ts"],"names":["toIterableIterator"],"mappings":";;;;;;AAuBO,SAAS,QAAA,CAA4B,UAA2C,KAA6B,EAAA;AACnH,EAAW,KAAA,MAAA,OAAA,IAAWA,yCAAmB,CAAA,QAAQ,CAAG,EAAA;AACnD,IAAI,IAAA,OAAA,KAAY,OAAc,OAAA,IAAA,CAAA;AAAA,GAC/B;AAEA,EAAO,OAAA,KAAA,CAAA;AACR,CAAA;AANgB,MAAA,CAAA,QAAA,EAAA,UAAA,CAAA","file":"contains.cjs","sourcesContent":["import type { IterableResolvable } from './from';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Advances the iterable until it finds the element, returning `true` if it's found and `false` otherwise.\n *\n * @param iterable The iterator in which to locate a value.\n * @param value The value to locate in the iterator.\n * @returns `true` if the value is found in the iterator; otherwise, `false`.\n *\n * @example\n * ```typescript\n * import { contains } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3, 4, 5];\n * console.log(contains(iterable, 3));\n * // Output: true\n * ```\n *\n * @remarks\n *\n * This function consumes the iterator until the value is found or the iterator is exhausted.\n */\nexport function contains<const ElementType>(iterable: IterableResolvable<ElementType>, value: ElementType): boolean {\n\tfor (const element of toIterableIterator(iterable)) {\n\t\tif (element === value) return true;\n\t}\n\n\treturn false;\n}\n"]}
@@ -15,5 +15,5 @@ function count(iterable) {
15
15
  __name(count, "count");
16
16
 
17
17
  exports.count = count;
18
- //# sourceMappingURL=out.js.map
18
+ //# sourceMappingURL=count.cjs.map
19
19
  //# sourceMappingURL=count.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/count.ts"],"names":["count"],"mappings":";;;;AAAA,SAAS,YAAqC;AAqBvC,SAAS,MAAyB,UAAmD;AAC3F,MAAIA,SAAQ;AACZ,QAAM,mBAAmB,KAAK,QAAQ;AACtC,SAAO,CAAC,iBAAiB,KAAK,EAAE,MAAM;AACrC,IAAAA;AAAA,EACD;AAEA,SAAOA;AACR;AARgB","sourcesContent":["import { from, type IterableResolvable } from './from';\n\n/**\n * Consumes the iterable and returns the number of elements.\n *\n * @param iterable An iterator that contains elements to be counted.\n * @returns The number of elements in the input iterator.\n *\n * @example\n * ```typescript\n * import { count } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3, 4, 5];\n * console.log(count(iterable));\n * // Output: 5\n * ```\n *\n * @remarks\n *\n * This function consumes the entire iterator.\n */\nexport function count<const ElementType>(iterable: IterableResolvable<ElementType>): number {\n\tlet count = 0;\n\tconst resolvedIterable = from(iterable);\n\twhile (!resolvedIterable.next().done) {\n\t\tcount++;\n\t}\n\n\treturn count;\n}\n"]}
1
+ {"version":3,"sources":["../../../src/lib/count.ts"],"names":["count","from"],"mappings":";;;;;;AAqBO,SAAS,MAAyB,QAAmD,EAAA;AAC3F,EAAA,IAAIA,MAAQ,GAAA,CAAA,CAAA;AACZ,EAAM,MAAA,gBAAA,GAAmBC,cAAK,QAAQ,CAAA,CAAA;AACtC,EAAA,OAAO,CAAC,gBAAA,CAAiB,IAAK,EAAA,CAAE,IAAM,EAAA;AACrC,IAAAD,MAAAA,EAAAA,CAAAA;AAAA,GACD;AAEA,EAAOA,OAAAA,MAAAA,CAAAA;AACR,CAAA;AARgB,MAAA,CAAA,KAAA,EAAA,OAAA,CAAA","file":"count.cjs","sourcesContent":["import { from, type IterableResolvable } from './from';\n\n/**\n * Consumes the iterable and returns the number of elements.\n *\n * @param iterable An iterator that contains elements to be counted.\n * @returns The number of elements in the input iterator.\n *\n * @example\n * ```typescript\n * import { count } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3, 4, 5];\n * console.log(count(iterable));\n * // Output: 5\n * ```\n *\n * @remarks\n *\n * This function consumes the entire iterator.\n */\nexport function count<const ElementType>(iterable: IterableResolvable<ElementType>): number {\n\tlet count = 0;\n\tconst resolvedIterable = from(iterable);\n\twhile (!resolvedIterable.next().done) {\n\t\tcount++;\n\t}\n\n\treturn count;\n}\n"]}
@@ -19,5 +19,5 @@ function* cycle(iterable) {
19
19
  __name(cycle, "cycle");
20
20
 
21
21
  exports.cycle = cycle;
22
- //# sourceMappingURL=out.js.map
22
+ //# sourceMappingURL=cycle.cjs.map
23
23
  //# sourceMappingURL=cycle.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/cycle.ts"],"names":[],"mappings":";;;;AACA,SAAS,0BAA0B;AAkB5B,UAAU,MAAyB,UAA0E;AACnH,QAAM,UAAU,CAAC;AACjB,aAAW,WAAW,mBAAmB,QAAQ,GAAG;AACnD,UAAM;AACN,YAAQ,KAAK,OAAO;AAAA,EACrB;AAEA,SAAO,QAAQ,SAAS,GAAG;AAC1B,eAAW,WAAW,SAAS;AAC9B,YAAM;AAAA,IACP;AAAA,EACD;AACD;AAZiB","sourcesContent":["import type { IterableResolvable } from './from';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Creates an infinite iterable by cycling through the elements of the input iterable.\n *\n * @param iterable An iterator to cycle over.\n *\n * @example\n * ```typescript\n * import { cycle } from '@sapphire/iterator-utilities';\n *\n * const iterable = cycle([1, 2, 3]);\n * for (const element of iterable) {\n * \tconsole.log(element);\n * \t// Output: 1, 2, 3, 1, 2, 3, 1, 2, 3, ...\n * }\n * ```\n */\nexport function* cycle<const ElementType>(iterable: IterableResolvable<ElementType>): IterableIterator<ElementType> {\n\tconst results = [] as ElementType[];\n\tfor (const element of toIterableIterator(iterable)) {\n\t\tyield element;\n\t\tresults.push(element);\n\t}\n\n\twhile (results.length > 0) {\n\t\tfor (const element of results) {\n\t\t\tyield element;\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"sources":["../../../src/lib/cycle.ts"],"names":["toIterableIterator"],"mappings":";;;;;;AAmBO,UAAU,MAAyB,QAA0E,EAAA;AACnH,EAAA,MAAM,UAAU,EAAC,CAAA;AACjB,EAAW,KAAA,MAAA,OAAA,IAAWA,yCAAmB,CAAA,QAAQ,CAAG,EAAA;AACnD,IAAM,MAAA,OAAA,CAAA;AACN,IAAA,OAAA,CAAQ,KAAK,OAAO,CAAA,CAAA;AAAA,GACrB;AAEA,EAAO,OAAA,OAAA,CAAQ,SAAS,CAAG,EAAA;AAC1B,IAAA,KAAA,MAAW,WAAW,OAAS,EAAA;AAC9B,MAAM,MAAA,OAAA,CAAA;AAAA,KACP;AAAA,GACD;AACD,CAAA;AAZiB,MAAA,CAAA,KAAA,EAAA,OAAA,CAAA","file":"cycle.cjs","sourcesContent":["import type { IterableResolvable } from './from';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Creates an infinite iterable by cycling through the elements of the input iterable.\n *\n * @param iterable An iterator to cycle over.\n *\n * @example\n * ```typescript\n * import { cycle } from '@sapphire/iterator-utilities';\n *\n * const iterable = cycle([1, 2, 3]);\n * for (const element of iterable) {\n * \tconsole.log(element);\n * \t// Output: 1, 2, 3, 1, 2, 3, 1, 2, 3, ...\n * }\n * ```\n */\nexport function* cycle<const ElementType>(iterable: IterableResolvable<ElementType>): IterableIterator<ElementType> {\n\tconst results = [] as ElementType[];\n\tfor (const element of toIterableIterator(iterable)) {\n\t\tyield element;\n\t\tresults.push(element);\n\t}\n\n\twhile (results.length > 0) {\n\t\tfor (const element of results) {\n\t\t\tyield element;\n\t\t}\n\t}\n}\n"]}
@@ -14,5 +14,5 @@ __name(difference, "difference");
14
14
  exports.difference = difference;
15
15
  exports.except = difference;
16
16
  exports.omit = difference;
17
- //# sourceMappingURL=out.js.map
17
+ //# sourceMappingURL=difference.cjs.map
18
18
  //# sourceMappingURL=difference.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/difference.ts"],"names":[],"mappings":";;;;AAAA,SAAS,cAAc;AAEvB,SAAS,0BAA0B;AAsB5B,SAAS,WACf,OACA,QACgC;AAChC,QAAM,MAAM,IAAI,IAAI,mBAAmB,MAAM,CAAC;AAC9C,SAAO,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,IAAI,KAAK,CAAC;AAChD;AANgB","sourcesContent":["import { filter } from './filter';\nimport type { IterableResolvable } from './from';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Creates an iterable with the elements of the first iterable that are not in the second iterable.\n *\n * @param first An iterator to return elements from.\n * @param second An iterator that contains elements to exclude from the result.\n *\n * @example\n * ```typescript\n * import { difference } from '@sapphire/iterator-utilities';\n *\n * const first = [1, 2, 3, 4, 5];\n * const second = [3, 4, 5, 6, 7];\n * console.log([...difference(first, second)]);\n * // Output: [1, 2]\n * ```\n *\n * @remarks\n *\n * This function consumes the entire `second` iterator to build the set of elements to exclude from `first`.\n */\nexport function difference<const ElementType>(\n\tfirst: IterableResolvable<ElementType>,\n\tsecond: IterableResolvable<ElementType>\n): IterableIterator<ElementType> {\n\tconst set = new Set(toIterableIterator(second));\n\treturn filter(first, (value) => !set.has(value));\n}\n\nexport { difference as except, difference as omit };\n"]}
1
+ {"version":3,"sources":["../../../src/lib/difference.ts"],"names":["toIterableIterator","filter"],"mappings":";;;;;;;AAwBO,SAAS,UAAA,CACf,OACA,MACgC,EAAA;AAChC,EAAA,MAAM,GAAM,GAAA,IAAI,GAAI,CAAAA,yCAAA,CAAmB,MAAM,CAAC,CAAA,CAAA;AAC9C,EAAO,OAAAC,iBAAA,CAAO,OAAO,CAAC,KAAA,KAAU,CAAC,GAAI,CAAA,GAAA,CAAI,KAAK,CAAC,CAAA,CAAA;AAChD,CAAA;AANgB,MAAA,CAAA,UAAA,EAAA,YAAA,CAAA","file":"difference.cjs","sourcesContent":["import { filter } from './filter';\nimport type { IterableResolvable } from './from';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Creates an iterable with the elements of the first iterable that are not in the second iterable.\n *\n * @param first An iterator to return elements from.\n * @param second An iterator that contains elements to exclude from the result.\n *\n * @example\n * ```typescript\n * import { difference } from '@sapphire/iterator-utilities';\n *\n * const first = [1, 2, 3, 4, 5];\n * const second = [3, 4, 5, 6, 7];\n * console.log([...difference(first, second)]);\n * // Output: [1, 2]\n * ```\n *\n * @remarks\n *\n * This function consumes the entire `second` iterator to build the set of elements to exclude from `first`.\n */\nexport function difference<const ElementType>(\n\tfirst: IterableResolvable<ElementType>,\n\tsecond: IterableResolvable<ElementType>\n): IterableIterator<ElementType> {\n\tconst set = new Set(toIterableIterator(second));\n\treturn filter(first, (value) => !set.has(value));\n}\n\nexport { difference as except, difference as omit };\n"]}
@@ -10,13 +10,10 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
10
10
  function drop(iterable, count) {
11
11
  count = _assertNotNegative_cjs.assertNotNegative(_toIntegerOrInfinityOrThrow_cjs.toIntegerOrInfinityOrThrow(count), count);
12
12
  const resolvedIterable = toIterableIterator_cjs.toIterableIterator(iterable);
13
- if (count === 0)
14
- return resolvedIterable;
15
- if (count === Number.POSITIVE_INFINITY)
16
- return empty_cjs.empty();
13
+ if (count === 0) return resolvedIterable;
14
+ if (count === Number.POSITIVE_INFINITY) return empty_cjs.empty();
17
15
  for (let i = 0; i < count; i++) {
18
- if (resolvedIterable.next().done)
19
- break;
16
+ if (resolvedIterable.next().done) break;
20
17
  }
21
18
  return resolvedIterable;
22
19
  }
@@ -24,5 +21,5 @@ __name(drop, "drop");
24
21
 
25
22
  exports.drop = drop;
26
23
  exports.skip = drop;
27
- //# sourceMappingURL=out.js.map
24
+ //# sourceMappingURL=drop.cjs.map
28
25
  //# sourceMappingURL=drop.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/drop.ts"],"names":[],"mappings":";;;;AAAA,SAAS,aAAa;AAEtB,SAAS,yBAAyB;AAClC,SAAS,kCAAkC;AAC3C,SAAS,0BAA0B;AAkB5B,SAAS,KAAwB,UAA2C,OAA8C;AAChI,UAAQ,kBAAkB,2BAA2B,KAAK,GAAG,KAAK;AAClE,QAAM,mBAAmB,mBAAmB,QAAQ;AAGpD,MAAI,UAAU;AAAG,WAAO;AAExB,MAAI,UAAU,OAAO;AAAmB,WAAO,MAAM;AAErD,WAAS,IAAI,GAAG,IAAI,OAAO,KAAK;AAC/B,QAAI,iBAAiB,KAAK,EAAE;AAAM;AAAA,EACnC;AAEA,SAAO;AACR;AAdgB","sourcesContent":["import { empty } from './empty';\nimport type { IterableResolvable } from './from';\nimport { assertNotNegative } from './shared/_assertNotNegative';\nimport { toIntegerOrInfinityOrThrow } from './shared/_toIntegerOrInfinityOrThrow';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Advances the iterable by `count` elements from the iterable.\n *\n * @param iterable An iterator to drop values from.\n * @param count The number of elements to drop from the start of the iteration.\n * @returns An iterator that contains the elements of the provided iterator, except for the first `count` elements.\n *\n * @example\n * ```typescript\n * import { drop } from '@sapphire/iterator-utilities';\n *\n * const iterable = drop(iterator, 2);\n * console.log([...iterable]);\n * // Output: [3, 4, 5]\n * ```\n */\nexport function drop<const ElementType>(iterable: IterableResolvable<ElementType>, count: number): IterableIterator<ElementType> {\n\tcount = assertNotNegative(toIntegerOrInfinityOrThrow(count), count);\n\tconst resolvedIterable = toIterableIterator(iterable);\n\n\t// If the count is 0, return the original iterable:\n\tif (count === 0) return resolvedIterable;\n\t// If the count is infinite, return an empty iterable:\n\tif (count === Number.POSITIVE_INFINITY) return empty();\n\n\tfor (let i = 0; i < count; i++) {\n\t\tif (resolvedIterable.next().done) break;\n\t}\n\n\treturn resolvedIterable;\n}\n\nexport { drop as skip };\n"]}
1
+ {"version":3,"sources":["../../../src/lib/drop.ts"],"names":["assertNotNegative","toIntegerOrInfinityOrThrow","toIterableIterator","empty"],"mappings":";;;;;;;;;AAsBO,SAAS,IAAA,CAAwB,UAA2C,KAA8C,EAAA;AAChI,EAAA,KAAA,GAAQA,wCAAkB,CAAAC,0DAAA,CAA2B,KAAK,CAAA,EAAG,KAAK,CAAA,CAAA;AAClE,EAAM,MAAA,gBAAA,GAAmBC,0CAAmB,QAAQ,CAAA,CAAA;AAGpD,EAAI,IAAA,KAAA,KAAU,GAAU,OAAA,gBAAA,CAAA;AAExB,EAAA,IAAI,KAAU,KAAA,MAAA,CAAO,iBAAmB,EAAA,OAAOC,eAAM,EAAA,CAAA;AAErD,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,KAAA,EAAO,CAAK,EAAA,EAAA;AAC/B,IAAI,IAAA,gBAAA,CAAiB,IAAK,EAAA,CAAE,IAAM,EAAA,MAAA;AAAA,GACnC;AAEA,EAAO,OAAA,gBAAA,CAAA;AACR,CAAA;AAdgB,MAAA,CAAA,IAAA,EAAA,MAAA,CAAA","file":"drop.cjs","sourcesContent":["import { empty } from './empty';\nimport type { IterableResolvable } from './from';\nimport { assertNotNegative } from './shared/_assertNotNegative';\nimport { toIntegerOrInfinityOrThrow } from './shared/_toIntegerOrInfinityOrThrow';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Advances the iterable by `count` elements from the iterable.\n *\n * @param iterable An iterator to drop values from.\n * @param count The number of elements to drop from the start of the iteration.\n * @returns An iterator that contains the elements of the provided iterator, except for the first `count` elements.\n *\n * @example\n * ```typescript\n * import { drop } from '@sapphire/iterator-utilities';\n *\n * const iterable = drop(iterator, 2);\n * console.log([...iterable]);\n * // Output: [3, 4, 5]\n * ```\n */\nexport function drop<const ElementType>(iterable: IterableResolvable<ElementType>, count: number): IterableIterator<ElementType> {\n\tcount = assertNotNegative(toIntegerOrInfinityOrThrow(count), count);\n\tconst resolvedIterable = toIterableIterator(iterable);\n\n\t// If the count is 0, return the original iterable:\n\tif (count === 0) return resolvedIterable;\n\t// If the count is infinite, return an empty iterable:\n\tif (count === Number.POSITIVE_INFINITY) return empty();\n\n\tfor (let i = 0; i < count; i++) {\n\t\tif (resolvedIterable.next().done) break;\n\t}\n\n\treturn resolvedIterable;\n}\n\nexport { drop as skip };\n"]}
@@ -11,13 +11,12 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
11
11
  function dropLast(iterable, count) {
12
12
  count = _assertNotNegative_cjs.assertNotNegative(_toIntegerOrInfinityOrThrow_cjs.toIntegerOrInfinityOrThrow(count), count);
13
13
  const array = toArray_cjs.toArray(iterable);
14
- if (array.length <= count)
15
- return empty_cjs.empty();
14
+ if (array.length <= count) return empty_cjs.empty();
16
15
  return take_cjs.take(array.values(), array.length - count);
17
16
  }
18
17
  __name(dropLast, "dropLast");
19
18
 
20
19
  exports.dropLast = dropLast;
21
20
  exports.skipLast = dropLast;
22
- //# sourceMappingURL=out.js.map
21
+ //# sourceMappingURL=dropLast.cjs.map
23
22
  //# sourceMappingURL=dropLast.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/dropLast.ts"],"names":[],"mappings":";;;;AAAA,SAAS,aAAa;AAEtB,SAAS,yBAAyB;AAClC,SAAS,kCAAkC;AAC3C,SAAS,YAAY;AACrB,SAAS,eAAe;AAsBjB,SAAS,SAA4B,UAA2C,OAA8C;AACpI,UAAQ,kBAAkB,2BAA2B,KAAK,GAAG,KAAK;AAClE,QAAM,QAAQ,QAAQ,QAAQ;AAC9B,MAAI,MAAM,UAAU;AAAO,WAAO,MAAM;AACxC,SAAO,KAAK,MAAM,OAAO,GAAG,MAAM,SAAS,KAAK;AACjD;AALgB","sourcesContent":["import { empty } from './empty';\nimport type { IterableResolvable } from './from';\nimport { assertNotNegative } from './shared/_assertNotNegative';\nimport { toIntegerOrInfinityOrThrow } from './shared/_toIntegerOrInfinityOrThrow';\nimport { take } from './take';\nimport { toArray } from './toArray';\n\n/**\n * Consumes the iterable, creating a new iterator without the last `count` elements from the iterable.\n *\n * @param iterable An iterator to drop values from.\n * @param count The number of values to drop from the end of the iterator.\n * @returns An iterator that contains the elements of the provided iterator, except for the last `count` elements.\n *\n * @example\n * ```typescript\n * import { dropLast } from '@sapphire/iterator-utilities';\n *\n * const iterable = dropLast([1, 2, 3, 4, 5], 2);\n * console.log([...iterable]);\n * // Output: [1, 2, 3]\n * ```\n *\n * @remarks\n *\n * This function consumes the entire iterator.\n */\nexport function dropLast<const ElementType>(iterable: IterableResolvable<ElementType>, count: number): IterableIterator<ElementType> {\n\tcount = assertNotNegative(toIntegerOrInfinityOrThrow(count), count);\n\tconst array = toArray(iterable);\n\tif (array.length <= count) return empty();\n\treturn take(array.values(), array.length - count);\n}\n\nexport { dropLast as skipLast };\n"]}
1
+ {"version":3,"sources":["../../../src/lib/dropLast.ts"],"names":["assertNotNegative","toIntegerOrInfinityOrThrow","toArray","empty","take"],"mappings":";;;;;;;;;;AA2BO,SAAS,QAAA,CAA4B,UAA2C,KAA8C,EAAA;AACpI,EAAA,KAAA,GAAQA,wCAAkB,CAAAC,0DAAA,CAA2B,KAAK,CAAA,EAAG,KAAK,CAAA,CAAA;AAClE,EAAM,MAAA,KAAA,GAAQC,oBAAQ,QAAQ,CAAA,CAAA;AAC9B,EAAA,IAAI,KAAM,CAAA,MAAA,IAAU,KAAO,EAAA,OAAOC,eAAM,EAAA,CAAA;AACxC,EAAA,OAAOC,cAAK,KAAM,CAAA,MAAA,EAAU,EAAA,KAAA,CAAM,SAAS,KAAK,CAAA,CAAA;AACjD,CAAA;AALgB,MAAA,CAAA,QAAA,EAAA,UAAA,CAAA","file":"dropLast.cjs","sourcesContent":["import { empty } from './empty';\nimport type { IterableResolvable } from './from';\nimport { assertNotNegative } from './shared/_assertNotNegative';\nimport { toIntegerOrInfinityOrThrow } from './shared/_toIntegerOrInfinityOrThrow';\nimport { take } from './take';\nimport { toArray } from './toArray';\n\n/**\n * Consumes the iterable, creating a new iterator without the last `count` elements from the iterable.\n *\n * @param iterable An iterator to drop values from.\n * @param count The number of values to drop from the end of the iterator.\n * @returns An iterator that contains the elements of the provided iterator, except for the last `count` elements.\n *\n * @example\n * ```typescript\n * import { dropLast } from '@sapphire/iterator-utilities';\n *\n * const iterable = dropLast([1, 2, 3, 4, 5], 2);\n * console.log([...iterable]);\n * // Output: [1, 2, 3]\n * ```\n *\n * @remarks\n *\n * This function consumes the entire iterator.\n */\nexport function dropLast<const ElementType>(iterable: IterableResolvable<ElementType>, count: number): IterableIterator<ElementType> {\n\tcount = assertNotNegative(toIntegerOrInfinityOrThrow(count), count);\n\tconst array = toArray(iterable);\n\tif (array.length <= count) return empty();\n\treturn take(array.values(), array.length - count);\n}\n\nexport { dropLast as skipLast };\n"]}
@@ -18,5 +18,5 @@ __name(dropWhile, "dropWhile");
18
18
 
19
19
  exports.dropWhile = dropWhile;
20
20
  exports.skipWhile = dropWhile;
21
- //# sourceMappingURL=out.js.map
21
+ //# sourceMappingURL=dropWhile.cjs.map
22
22
  //# sourceMappingURL=dropWhile.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/dropWhile.ts"],"names":[],"mappings":";;;;AACA,SAAS,sBAAsB;AAC/B,SAAS,0BAA0B;AA4B5B,UAAU,UAChB,UACA,YACgC;AAChC,eAAa,eAAe,UAAU;AAEtC,MAAI,QAAQ;AACZ,aAAW,SAAS,mBAAmB,QAAQ,GAAG;AACjD,QAAI,CAAC,WAAW,OAAO,OAAO,GAAG;AAChC,YAAM;AAAA,IACP;AAAA,EACD;AACD;AAZiB","sourcesContent":["import type { IterableResolvable } from './from';\nimport { assertFunction } from './shared/_assertFunction';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Creates a new iterator without the elements that satisfy the specified test.\n *\n * @param iterable An iterator to drop values from.\n * @param callbackFn A function to execute for each element produced by the iterator. It should return a falsy value to make the element yielded by the iterator helper, and a truthy value otherwise.\n * @returns An iterator that produces elements from the given iterator that don't satisfy the specified test.\n *\n * @example\n * ```typescript\n * import { dropWhile } from '@sapphire/iterator-utilities';\n *\n * const iterable = dropWhile([1, 2, 3, 4, 5], (value) => value < 3);\n * console.log([...iterable]);\n * // Output: [3, 4, 5]\n * ```\n *\n * @seealso {@link filter} or {@link takeWhile} for the opposite behavior.\n */\nexport function dropWhile<const ElementType, const FilteredType extends ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => element is FilteredType\n): IterableIterator<Exclude<ElementType, FilteredType>>;\nexport function dropWhile<const ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => boolean\n): IterableIterator<ElementType>;\nexport function* dropWhile<const ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => boolean\n): IterableIterator<ElementType> {\n\tcallbackFn = assertFunction(callbackFn);\n\n\tlet index = 0;\n\tfor (const value of toIterableIterator(iterable)) {\n\t\tif (!callbackFn(value, index++)) {\n\t\t\tyield value;\n\t\t}\n\t}\n}\n\nexport { dropWhile as skipWhile };\n"]}
1
+ {"version":3,"sources":["../../../src/lib/dropWhile.ts"],"names":["assertFunction","toIterableIterator"],"mappings":";;;;;;;AA8BO,UAAU,SAAA,CAChB,UACA,UACgC,EAAA;AAChC,EAAA,UAAA,GAAaA,mCAAe,UAAU,CAAA,CAAA;AAEtC,EAAA,IAAI,KAAQ,GAAA,CAAA,CAAA;AACZ,EAAW,KAAA,MAAA,KAAA,IAASC,yCAAmB,CAAA,QAAQ,CAAG,EAAA;AACjD,IAAA,IAAI,CAAC,UAAA,CAAW,KAAO,EAAA,KAAA,EAAO,CAAG,EAAA;AAChC,MAAM,MAAA,KAAA,CAAA;AAAA,KACP;AAAA,GACD;AACD,CAAA;AAZiB,MAAA,CAAA,SAAA,EAAA,WAAA,CAAA","file":"dropWhile.cjs","sourcesContent":["import type { IterableResolvable } from './from';\nimport { assertFunction } from './shared/_assertFunction';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Creates a new iterator without the elements that satisfy the specified test.\n *\n * @param iterable An iterator to drop values from.\n * @param callbackFn A function to execute for each element produced by the iterator. It should return a falsy value to make the element yielded by the iterator helper, and a truthy value otherwise.\n * @returns An iterator that produces elements from the given iterator that don't satisfy the specified test.\n *\n * @example\n * ```typescript\n * import { dropWhile } from '@sapphire/iterator-utilities';\n *\n * const iterable = dropWhile([1, 2, 3, 4, 5], (value) => value < 3);\n * console.log([...iterable]);\n * // Output: [3, 4, 5]\n * ```\n *\n * @seealso {@link filter} or {@link takeWhile} for the opposite behavior.\n */\nexport function dropWhile<const ElementType, const FilteredType extends ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => element is FilteredType\n): IterableIterator<Exclude<ElementType, FilteredType>>;\nexport function dropWhile<const ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => boolean\n): IterableIterator<ElementType>;\nexport function* dropWhile<const ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => boolean\n): IterableIterator<ElementType> {\n\tcallbackFn = assertFunction(callbackFn);\n\n\tlet index = 0;\n\tfor (const value of toIterableIterator(iterable)) {\n\t\tif (!callbackFn(value, index++)) {\n\t\t\tyield value;\n\t\t}\n\t}\n}\n\nexport { dropWhile as skipWhile };\n"]}
@@ -10,5 +10,5 @@ function empty() {
10
10
  __name(empty, "empty");
11
11
 
12
12
  exports.empty = empty;
13
- //# sourceMappingURL=out.js.map
13
+ //# sourceMappingURL=empty.cjs.map
14
14
  //# sourceMappingURL=empty.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/empty.ts"],"names":[],"mappings":";;;;AAAA,SAAS,4BAA4B;AAgB9B,SAAS,QAAkE;AACjF,SAAO,qBAAkC,OAAO,EAAE,MAAM,MAAM,OAAO,OAAU,EAAE;AAClF;AAFgB","sourcesContent":["import { makeIterableIterator } from './shared/_makeIterableIterator';\n\n/**\n * Creates an empty iterator.\n *\n * @returns An empty iterator.\n *\n * @example\n * ```typescript\n * import { empty } from '@sapphire/iterator-utilities';\n *\n * const iterable = empty();\n * console.log([...iterable]);\n * // Output: []\n * ```\n */\nexport function empty<const ElementType = never>(): IterableIterator<ElementType> {\n\treturn makeIterableIterator<ElementType>(() => ({ done: true, value: undefined }));\n}\n"]}
1
+ {"version":3,"sources":["../../../src/lib/empty.ts"],"names":["makeIterableIterator"],"mappings":";;;;;;AAgBO,SAAS,KAAkE,GAAA;AACjF,EAAA,OAAOA,+CAAkC,OAAO,EAAE,MAAM,IAAM,EAAA,KAAA,EAAO,QAAY,CAAA,CAAA,CAAA;AAClF,CAAA;AAFgB,MAAA,CAAA,KAAA,EAAA,OAAA,CAAA","file":"empty.cjs","sourcesContent":["import { makeIterableIterator } from './shared/_makeIterableIterator';\n\n/**\n * Creates an empty iterator.\n *\n * @returns An empty iterator.\n *\n * @example\n * ```typescript\n * import { empty } from '@sapphire/iterator-utilities';\n *\n * const iterable = empty();\n * console.log([...iterable]);\n * // Output: []\n * ```\n */\nexport function empty<const ElementType = never>(): IterableIterator<ElementType> {\n\treturn makeIterableIterator<ElementType>(() => ({ done: true, value: undefined }));\n}\n"]}
@@ -13,5 +13,5 @@ function* enumerate(iterable) {
13
13
  __name(enumerate, "enumerate");
14
14
 
15
15
  exports.enumerate = enumerate;
16
- //# sourceMappingURL=out.js.map
16
+ //# sourceMappingURL=enumerate.cjs.map
17
17
  //# sourceMappingURL=enumerate.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/enumerate.ts"],"names":[],"mappings":";;;;AACA,SAAS,0BAA0B;AAqB5B,UAAU,UAA6B,UAAoF;AACjI,MAAI,QAAQ;AACZ,aAAW,SAAS,mBAAmB,QAAQ,GAAG;AACjD,UAAM,CAAC,SAAS,KAAK;AAAA,EACtB;AACD;AALiB","sourcesContent":["import type { IterableResolvable } from './from';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Creates a new iterable that yields the index and value of each element.\n *\n * @param iterable An iterator to enumerate.\n * @returns An iterator that yields the index and value of each element in the source iterator.\n *\n * @example\n * ```typescript\n * import { enumerate } from '@sapphire/iterator-utilities';\n *\n * const iterable = ['a', 'b', 'c'];\n * for (const [index, value] of enumerate(iterable)) {\n * \tconsole.log(`Index: ${index}, Value: ${value}`);\n * \t// Output: Index: 0, Value: a\n * \t// Output: Index: 1, Value: b\n * \t// Output: Index: 2, Value: c\n * }\n * ```\n */\nexport function* enumerate<const ElementType>(iterable: IterableResolvable<ElementType>): IterableIterator<[number, ElementType]> {\n\tlet index = 0;\n\tfor (const value of toIterableIterator(iterable)) {\n\t\tyield [index++, value];\n\t}\n}\n"]}
1
+ {"version":3,"sources":["../../../src/lib/enumerate.ts"],"names":["toIterableIterator"],"mappings":";;;;;;AAsBO,UAAU,UAA6B,QAAoF,EAAA;AACjI,EAAA,IAAI,KAAQ,GAAA,CAAA,CAAA;AACZ,EAAW,KAAA,MAAA,KAAA,IAASA,yCAAmB,CAAA,QAAQ,CAAG,EAAA;AACjD,IAAM,MAAA,CAAC,SAAS,KAAK,CAAA,CAAA;AAAA,GACtB;AACD,CAAA;AALiB,MAAA,CAAA,SAAA,EAAA,WAAA,CAAA","file":"enumerate.cjs","sourcesContent":["import type { IterableResolvable } from './from';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Creates a new iterable that yields the index and value of each element.\n *\n * @param iterable An iterator to enumerate.\n * @returns An iterator that yields the index and value of each element in the source iterator.\n *\n * @example\n * ```typescript\n * import { enumerate } from '@sapphire/iterator-utilities';\n *\n * const iterable = ['a', 'b', 'c'];\n * for (const [index, value] of enumerate(iterable)) {\n * \tconsole.log(`Index: ${index}, Value: ${value}`);\n * \t// Output: Index: 0, Value: a\n * \t// Output: Index: 1, Value: b\n * \t// Output: Index: 2, Value: c\n * }\n * ```\n */\nexport function* enumerate<const ElementType>(iterable: IterableResolvable<ElementType>): IterableIterator<[number, ElementType]> {\n\tlet index = 0;\n\tfor (const value of toIterableIterator(iterable)) {\n\t\tyield [index++, value];\n\t}\n}\n"]}
@@ -9,13 +9,12 @@ function every(iterable, callbackFn) {
9
9
  callbackFn = _assertFunction_cjs.assertFunction(callbackFn);
10
10
  let index = 0;
11
11
  for (const value of toIterableIterator_cjs.toIterableIterator(iterable)) {
12
- if (!callbackFn(value, index++))
13
- return false;
12
+ if (!callbackFn(value, index++)) return false;
14
13
  }
15
14
  return true;
16
15
  }
17
16
  __name(every, "every");
18
17
 
19
18
  exports.every = every;
20
- //# sourceMappingURL=out.js.map
19
+ //# sourceMappingURL=every.cjs.map
21
20
  //# sourceMappingURL=every.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/every.ts"],"names":[],"mappings":";;;;AACA,SAAS,sBAAsB;AAC/B,SAAS,0BAA0B;AAiC5B,SAAS,MAAyB,UAA2C,YAA8D;AACjJ,eAAa,eAAe,UAAU;AAEtC,MAAI,QAAQ;AACZ,aAAW,SAAS,mBAAmB,QAAQ,GAAG;AACjD,QAAI,CAAC,WAAW,OAAO,OAAO;AAAG,aAAO;AAAA,EACzC;AAEA,SAAO;AACR;AATgB","sourcesContent":["import type { IterableResolvable } from './from';\nimport { assertFunction } from './shared/_assertFunction';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Tests whether all elements in the iterable pass the test implemented by the provided function.\n *\n * @param iterable The iterator to check.\n * @param callbackFn A function to execute for each element produced by the iterator. It should return a truthy value to indicate the element passes the test, and a falsy value otherwise.\n * @returns `true` if callbackFn returns a truthy value for every element. Otherwise, `false`.\n *\n * @example\n * ```typescript\n * import { every } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3, 4, 5];\n * console.log(every(iterable, (value) => value < 10));\n * // Output: true\n *\n * console.log(every(iterable, (value) => value < 3));\n * // Output: false\n * ```\n *\n * @remarks\n *\n * This function consumes the entire iterator.\n */\nexport function every<const ElementType, const FilteredType extends ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => element is FilteredType\n): iterable is IterableIterator<FilteredType>;\nexport function every<const ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => boolean\n): boolean;\nexport function every<const ElementType>(iterable: IterableResolvable<ElementType>, callbackFn: (element: ElementType, index: number) => boolean) {\n\tcallbackFn = assertFunction(callbackFn);\n\n\tlet index = 0;\n\tfor (const value of toIterableIterator(iterable)) {\n\t\tif (!callbackFn(value, index++)) return false;\n\t}\n\n\treturn true;\n}\n"]}
1
+ {"version":3,"sources":["../../../src/lib/every.ts"],"names":["assertFunction","toIterableIterator"],"mappings":";;;;;;;AAmCO,SAAS,KAAA,CAAyB,UAA2C,UAA8D,EAAA;AACjJ,EAAA,UAAA,GAAaA,mCAAe,UAAU,CAAA,CAAA;AAEtC,EAAA,IAAI,KAAQ,GAAA,CAAA,CAAA;AACZ,EAAW,KAAA,MAAA,KAAA,IAASC,yCAAmB,CAAA,QAAQ,CAAG,EAAA;AACjD,IAAA,IAAI,CAAC,UAAA,CAAW,KAAO,EAAA,KAAA,EAAO,GAAU,OAAA,KAAA,CAAA;AAAA,GACzC;AAEA,EAAO,OAAA,IAAA,CAAA;AACR,CAAA;AATgB,MAAA,CAAA,KAAA,EAAA,OAAA,CAAA","file":"every.cjs","sourcesContent":["import type { IterableResolvable } from './from';\nimport { assertFunction } from './shared/_assertFunction';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Tests whether all elements in the iterable pass the test implemented by the provided function.\n *\n * @param iterable The iterator to check.\n * @param callbackFn A function to execute for each element produced by the iterator. It should return a truthy value to indicate the element passes the test, and a falsy value otherwise.\n * @returns `true` if callbackFn returns a truthy value for every element. Otherwise, `false`.\n *\n * @example\n * ```typescript\n * import { every } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3, 4, 5];\n * console.log(every(iterable, (value) => value < 10));\n * // Output: true\n *\n * console.log(every(iterable, (value) => value < 3));\n * // Output: false\n * ```\n *\n * @remarks\n *\n * This function consumes the entire iterator.\n */\nexport function every<const ElementType, const FilteredType extends ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => element is FilteredType\n): iterable is IterableIterator<FilteredType>;\nexport function every<const ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => boolean\n): boolean;\nexport function every<const ElementType>(iterable: IterableResolvable<ElementType>, callbackFn: (element: ElementType, index: number) => boolean) {\n\tcallbackFn = assertFunction(callbackFn);\n\n\tlet index = 0;\n\tfor (const value of toIterableIterator(iterable)) {\n\t\tif (!callbackFn(value, index++)) return false;\n\t}\n\n\treturn true;\n}\n"]}
@@ -9,13 +9,12 @@ function* filter(iterable, callbackFn) {
9
9
  callbackFn = _assertFunction_cjs.assertFunction(callbackFn);
10
10
  let index = 0;
11
11
  for (const value of toIterableIterator_cjs.toIterableIterator(iterable)) {
12
- if (callbackFn(value, index++))
13
- yield value;
12
+ if (callbackFn(value, index++)) yield value;
14
13
  }
15
14
  }
16
15
  __name(filter, "filter");
17
16
 
18
17
  exports.filter = filter;
19
18
  exports.takeWhile = filter;
20
- //# sourceMappingURL=out.js.map
19
+ //# sourceMappingURL=filter.cjs.map
21
20
  //# sourceMappingURL=filter.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/filter.ts"],"names":[],"mappings":";;;;AACA,SAAS,sBAAsB;AAC/B,SAAS,0BAA0B;AA0B5B,UAAU,OAChB,UACA,YACgC;AAChC,eAAa,eAAe,UAAU;AAEtC,MAAI,QAAQ;AACZ,aAAW,SAAS,mBAAmB,QAAQ,GAAG;AACjD,QAAI,WAAW,OAAO,OAAO;AAAG,YAAM;AAAA,EACvC;AACD;AAViB","sourcesContent":["import type { IterableResolvable } from './from';\nimport { assertFunction } from './shared/_assertFunction';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Creates an iterable with the elements that pass the test implemented by the provided function.\n *\n * @param iterable The iterator to filter.\n * @param callbackFn A function to execute for each element produced by the iterator. It should return a truthy value to make the element yielded by the iterator helper, and a falsy value otherwise.\n * @returns An iterator that produces elements from the given iterator that satisfy the specified test.\n *\n * @example\n * ```typescript\n * import { filter } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3, 4, 5];\n * console.log([...filter(iterable, (value) => value % 2 === 0)]);\n * // Output: [2, 4]\n * ```\n */\nexport function filter<const ElementType, const FilteredType extends ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => element is FilteredType\n): IterableIterator<FilteredType>;\nexport function filter<const ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => boolean\n): IterableIterator<ElementType>;\nexport function* filter<ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => boolean\n): IterableIterator<ElementType> {\n\tcallbackFn = assertFunction(callbackFn);\n\n\tlet index = 0;\n\tfor (const value of toIterableIterator(iterable)) {\n\t\tif (callbackFn(value, index++)) yield value;\n\t}\n}\n\nexport { filter as takeWhile };\n"]}
1
+ {"version":3,"sources":["../../../src/lib/filter.ts"],"names":["assertFunction","toIterableIterator"],"mappings":";;;;;;;AA4BO,UAAU,MAAA,CAChB,UACA,UACgC,EAAA;AAChC,EAAA,UAAA,GAAaA,mCAAe,UAAU,CAAA,CAAA;AAEtC,EAAA,IAAI,KAAQ,GAAA,CAAA,CAAA;AACZ,EAAW,KAAA,MAAA,KAAA,IAASC,yCAAmB,CAAA,QAAQ,CAAG,EAAA;AACjD,IAAA,IAAI,UAAW,CAAA,KAAA,EAAO,KAAO,EAAA,CAAA,EAAS,MAAA,KAAA,CAAA;AAAA,GACvC;AACD,CAAA;AAViB,MAAA,CAAA,MAAA,EAAA,QAAA,CAAA","file":"filter.cjs","sourcesContent":["import type { IterableResolvable } from './from';\nimport { assertFunction } from './shared/_assertFunction';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Creates an iterable with the elements that pass the test implemented by the provided function.\n *\n * @param iterable The iterator to filter.\n * @param callbackFn A function to execute for each element produced by the iterator. It should return a truthy value to make the element yielded by the iterator helper, and a falsy value otherwise.\n * @returns An iterator that produces elements from the given iterator that satisfy the specified test.\n *\n * @example\n * ```typescript\n * import { filter } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3, 4, 5];\n * console.log([...filter(iterable, (value) => value % 2 === 0)]);\n * // Output: [2, 4]\n * ```\n */\nexport function filter<const ElementType, const FilteredType extends ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => element is FilteredType\n): IterableIterator<FilteredType>;\nexport function filter<const ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => boolean\n): IterableIterator<ElementType>;\nexport function* filter<ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => boolean\n): IterableIterator<ElementType> {\n\tcallbackFn = assertFunction(callbackFn);\n\n\tlet index = 0;\n\tfor (const value of toIterableIterator(iterable)) {\n\t\tif (callbackFn(value, index++)) yield value;\n\t}\n}\n\nexport { filter as takeWhile };\n"]}
@@ -11,5 +11,5 @@ function find(iterable, callbackFn) {
11
11
  __name(find, "find");
12
12
 
13
13
  exports.find = find;
14
- //# sourceMappingURL=out.js.map
14
+ //# sourceMappingURL=find.cjs.map
15
15
  //# sourceMappingURL=find.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/find.ts"],"names":[],"mappings":";;;;AAAA,SAAS,cAAc;AACvB,SAAS,aAAa;AA+Bf,SAAS,KACf,UACA,YAC0B;AAC1B,SAAO,MAAM,OAAO,UAAU,UAAU,CAAC;AAC1C;AALgB","sourcesContent":["import { filter } from './filter';\nimport { first } from './first';\nimport type { IterableResolvable } from './from';\n\n/**\n * Advances the iterable until it finds the element, returning it if it's found and `undefined` otherwise.\n *\n * @param iterable An iterator to search for a value in.\n * @param callbackFn A function that determines if a value is the one being searched for.\n * @returns\n *\n * @example\n * ```typescript\n * import { find } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3, 4, 5];\n * console.log(find(iterable, (value) => value % 2 === 0));\n * // Output: 2\n * ```\n *\n * @remarks\n *\n * This function consumes the iterator until the value is found or the iterator is exhausted.\n */\nexport function find<const ElementType, const FilteredType extends ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => element is FilteredType\n): FilteredType | undefined;\nexport function find<const ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => boolean\n): ElementType | undefined;\nexport function find<const ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => boolean\n): ElementType | undefined {\n\treturn first(filter(iterable, callbackFn));\n}\n"]}
1
+ {"version":3,"sources":["../../../src/lib/find.ts"],"names":["first","filter"],"mappings":";;;;;;;AAgCO,SAAS,IAAA,CACf,UACA,UAC0B,EAAA;AAC1B,EAAA,OAAOA,eAAM,CAAAC,iBAAA,CAAO,QAAU,EAAA,UAAU,CAAC,CAAA,CAAA;AAC1C,CAAA;AALgB,MAAA,CAAA,IAAA,EAAA,MAAA,CAAA","file":"find.cjs","sourcesContent":["import { filter } from './filter';\nimport { first } from './first';\nimport type { IterableResolvable } from './from';\n\n/**\n * Advances the iterable until it finds the element, returning it if it's found and `undefined` otherwise.\n *\n * @param iterable An iterator to search for a value in.\n * @param callbackFn A function that determines if a value is the one being searched for.\n * @returns\n *\n * @example\n * ```typescript\n * import { find } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3, 4, 5];\n * console.log(find(iterable, (value) => value % 2 === 0));\n * // Output: 2\n * ```\n *\n * @remarks\n *\n * This function consumes the iterator until the value is found or the iterator is exhausted.\n */\nexport function find<const ElementType, const FilteredType extends ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => element is FilteredType\n): FilteredType | undefined;\nexport function find<const ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => boolean\n): ElementType | undefined;\nexport function find<const ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => boolean\n): ElementType | undefined {\n\treturn first(filter(iterable, callbackFn));\n}\n"]}
@@ -19,5 +19,5 @@ function findIndex(iterable, callbackFn) {
19
19
  __name(findIndex, "findIndex");
20
20
 
21
21
  exports.findIndex = findIndex;
22
- //# sourceMappingURL=out.js.map
22
+ //# sourceMappingURL=findIndex.cjs.map
23
23
  //# sourceMappingURL=findIndex.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/findIndex.ts"],"names":[],"mappings":";;;;AACA,SAAS,sBAAsB;AAC/B,SAAS,0BAA0B;AAsB5B,SAAS,UACf,UACA,YACS;AACT,eAAa,eAAe,UAAU;AAEtC,MAAI,QAAQ;AACZ,aAAW,WAAW,mBAAmB,QAAQ,GAAG;AACnD,QAAI,WAAW,SAAS,KAAK,GAAG;AAC/B,aAAO;AAAA,IACR;AAEA;AAAA,EACD;AAEA,SAAO;AACR;AAhBgB","sourcesContent":["import type { IterableResolvable } from './from';\nimport { assertFunction } from './shared/_assertFunction';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Advances the iterable until it finds the element, returning its index if it's found and `-1` otherwise.\n *\n * @param iterable An iterator to search for an element in.\n * @param callbackFn A function that determines if an element is the one being searched for.\n * @returns The index of the first element that satisfies the predicate, or `-1` if no elements satisfy the predicate.\n *\n * @example\n * ```typescript\n * import { findIndex } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3, 4, 5];\n * console.log(findIndex(iterable, (value) => value % 2 === 0));\n * // Output: 1\n * ```\n *\n * @remarks\n *\n * This function consumes the iterator until the value is found or the iterator is exhausted.\n */\nexport function findIndex<const ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => boolean\n): number {\n\tcallbackFn = assertFunction(callbackFn);\n\n\tlet index = 0;\n\tfor (const element of toIterableIterator(iterable)) {\n\t\tif (callbackFn(element, index)) {\n\t\t\treturn index;\n\t\t}\n\n\t\tindex++;\n\t}\n\n\treturn -1;\n}\n"]}
1
+ {"version":3,"sources":["../../../src/lib/findIndex.ts"],"names":["assertFunction","toIterableIterator"],"mappings":";;;;;;;AAwBO,SAAS,SAAA,CACf,UACA,UACS,EAAA;AACT,EAAA,UAAA,GAAaA,mCAAe,UAAU,CAAA,CAAA;AAEtC,EAAA,IAAI,KAAQ,GAAA,CAAA,CAAA;AACZ,EAAW,KAAA,MAAA,OAAA,IAAWC,yCAAmB,CAAA,QAAQ,CAAG,EAAA;AACnD,IAAI,IAAA,UAAA,CAAW,OAAS,EAAA,KAAK,CAAG,EAAA;AAC/B,MAAO,OAAA,KAAA,CAAA;AAAA,KACR;AAEA,IAAA,KAAA,EAAA,CAAA;AAAA,GACD;AAEA,EAAO,OAAA,CAAA,CAAA,CAAA;AACR,CAAA;AAhBgB,MAAA,CAAA,SAAA,EAAA,WAAA,CAAA","file":"findIndex.cjs","sourcesContent":["import type { IterableResolvable } from './from';\nimport { assertFunction } from './shared/_assertFunction';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Advances the iterable until it finds the element, returning its index if it's found and `-1` otherwise.\n *\n * @param iterable An iterator to search for an element in.\n * @param callbackFn A function that determines if an element is the one being searched for.\n * @returns The index of the first element that satisfies the predicate, or `-1` if no elements satisfy the predicate.\n *\n * @example\n * ```typescript\n * import { findIndex } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3, 4, 5];\n * console.log(findIndex(iterable, (value) => value % 2 === 0));\n * // Output: 1\n * ```\n *\n * @remarks\n *\n * This function consumes the iterator until the value is found or the iterator is exhausted.\n */\nexport function findIndex<const ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => boolean\n): number {\n\tcallbackFn = assertFunction(callbackFn);\n\n\tlet index = 0;\n\tfor (const element of toIterableIterator(iterable)) {\n\t\tif (callbackFn(element, index)) {\n\t\t\treturn index;\n\t\t}\n\n\t\tindex++;\n\t}\n\n\treturn -1;\n}\n"]}
@@ -10,5 +10,5 @@ function first(iterable) {
10
10
  __name(first, "first");
11
11
 
12
12
  exports.first = first;
13
- //# sourceMappingURL=out.js.map
13
+ //# sourceMappingURL=first.cjs.map
14
14
  //# sourceMappingURL=first.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/first.ts"],"names":[],"mappings":";;;;AAAA,SAAS,YAAqC;AAqBvC,SAAS,MAAyB,UAAoE;AAC5G,SAAO,KAAK,QAAQ,EAAE,KAAK,EAAE;AAC9B;AAFgB","sourcesContent":["import { from, type IterableResolvable } from './from';\n\n/**\n * Consumes the first element of the iterable, returning it if it's found and `undefined` otherwise.\n *\n * @param iterable The iterator to return the first value of.\n * @returns The first value of the iterator, or `undefined` if the iterator is empty.\n *\n * @example\n * ```typescript\n * import { first } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3, 4, 5];\n * console.log(first(iterable));\n * // Output: 1\n * ```\n *\n * @remarks\n *\n * This function consumes the first value of the iterator.\n */\nexport function first<const ElementType>(iterable: IterableResolvable<ElementType>): ElementType | undefined {\n\treturn from(iterable).next().value;\n}\n"]}
1
+ {"version":3,"sources":["../../../src/lib/first.ts"],"names":["from"],"mappings":";;;;;;AAqBO,SAAS,MAAyB,QAAoE,EAAA;AAC5G,EAAA,OAAOA,aAAK,CAAA,QAAQ,CAAE,CAAA,IAAA,EAAO,CAAA,KAAA,CAAA;AAC9B,CAAA;AAFgB,MAAA,CAAA,KAAA,EAAA,OAAA,CAAA","file":"first.cjs","sourcesContent":["import { from, type IterableResolvable } from './from';\n\n/**\n * Consumes the first element of the iterable, returning it if it's found and `undefined` otherwise.\n *\n * @param iterable The iterator to return the first value of.\n * @returns The first value of the iterator, or `undefined` if the iterator is empty.\n *\n * @example\n * ```typescript\n * import { first } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3, 4, 5];\n * console.log(first(iterable));\n * // Output: 1\n * ```\n *\n * @remarks\n *\n * This function consumes the first value of the iterator.\n */\nexport function first<const ElementType>(iterable: IterableResolvable<ElementType>): ElementType | undefined {\n\treturn from(iterable).next().value;\n}\n"]}
@@ -12,5 +12,5 @@ function* flat(iterables) {
12
12
  __name(flat, "flat");
13
13
 
14
14
  exports.flat = flat;
15
- //# sourceMappingURL=out.js.map
15
+ //# sourceMappingURL=flat.cjs.map
16
16
  //# sourceMappingURL=flat.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/flat.ts"],"names":[],"mappings":";;;;AACA,SAAS,0BAA0B;AAiB5B,UAAU,KAAwB,WAA+F;AACvI,aAAW,SAAS,mBAAmB,SAAS,GAAG;AAClD,WAAO,mBAAmB,KAAK;AAAA,EAChC;AACD;AAJiB","sourcesContent":["import type { IterableResolvable } from './from';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Creates an iterable that yields the elements of each iterable in the input iterable.\n *\n * @param iterables An iterator to map.\n * @returns An iterator that yields the entries of each iterator.\n *\n * @example\n * ```typescript\n * import { flat } from '@sapphire/iterator-utilities';\n *\n * const iterable = flat([[1, 2], [3, 4], [5, 6]]);\n * console.log([...iterable]);\n * // Output: [1, 2, 3, 4, 5, 6]\n * ```\n */\nexport function* flat<const ElementType>(iterables: IterableResolvable<IterableResolvable<ElementType>>): IterableIterator<ElementType> {\n\tfor (const value of toIterableIterator(iterables)) {\n\t\tyield* toIterableIterator(value);\n\t}\n}\n"]}
1
+ {"version":3,"sources":["../../../src/lib/flat.ts"],"names":["toIterableIterator"],"mappings":";;;;;;AAkBO,UAAU,KAAwB,SAA+F,EAAA;AACvI,EAAW,KAAA,MAAA,KAAA,IAASA,yCAAmB,CAAA,SAAS,CAAG,EAAA;AAClD,IAAA,OAAOA,0CAAmB,KAAK,CAAA,CAAA;AAAA,GAChC;AACD,CAAA;AAJiB,MAAA,CAAA,IAAA,EAAA,MAAA,CAAA","file":"flat.cjs","sourcesContent":["import type { IterableResolvable } from './from';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Creates an iterable that yields the elements of each iterable in the input iterable.\n *\n * @param iterables An iterator to map.\n * @returns An iterator that yields the entries of each iterator.\n *\n * @example\n * ```typescript\n * import { flat } from '@sapphire/iterator-utilities';\n *\n * const iterable = flat([[1, 2], [3, 4], [5, 6]]);\n * console.log([...iterable]);\n * // Output: [1, 2, 3, 4, 5, 6]\n * ```\n */\nexport function* flat<const ElementType>(iterables: IterableResolvable<IterableResolvable<ElementType>>): IterableIterator<ElementType> {\n\tfor (const value of toIterableIterator(iterables)) {\n\t\tyield* toIterableIterator(value);\n\t}\n}\n"]}
@@ -15,5 +15,5 @@ function* flatMap(iterable, callbackFn) {
15
15
  __name(flatMap, "flatMap");
16
16
 
17
17
  exports.flatMap = flatMap;
18
- //# sourceMappingURL=out.js.map
18
+ //# sourceMappingURL=flatMap.cjs.map
19
19
  //# sourceMappingURL=flatMap.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/flatMap.ts"],"names":[],"mappings":";;;;AACA,SAAS,sBAAsB;AAC/B,SAAS,0BAA0B;AAkB5B,UAAU,QAChB,UACA,YAC+B;AAC/B,eAAa,eAAe,UAAU;AAEtC,MAAI,QAAQ;AACZ,aAAW,SAAS,mBAAmB,QAAQ,GAAG;AACjD,WAAO,mBAAmB,WAAW,OAAO,OAAO,CAAC;AAAA,EACrD;AACD;AAViB","sourcesContent":["import type { IterableResolvable } from './from';\nimport { assertFunction } from './shared/_assertFunction';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Creates an iterable that yields the elements of each iterable returned by the provided function on each element of the input iterable.\n *\n * @param iterable An iterator to map.\n * @param callbackFn A function to execute for each element produced by the iterator. It should return an iterator or iterable that yields elements to be yielded by `flatMap()`, or a single non-iterator/iterable value to be yielded.\n * @returns An iterator that applies a function to each element of the input iterator and yields the results.\n *\n * @example\n * ```typescript\n * import { flatMap } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3];\n * console.log([...flatMap(iterable, (value) => [value, value * 2])]);\n * // Output: [1, 2, 2, 4, 3, 6]\n * ```\n */\nexport function* flatMap<const ElementType, const MappedType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => IterableResolvable<MappedType>\n): IterableIterator<MappedType> {\n\tcallbackFn = assertFunction(callbackFn);\n\n\tlet index = 0;\n\tfor (const value of toIterableIterator(iterable)) {\n\t\tyield* toIterableIterator(callbackFn(value, index++));\n\t}\n}\n"]}
1
+ {"version":3,"sources":["../../../src/lib/flatMap.ts"],"names":["assertFunction","toIterableIterator"],"mappings":";;;;;;;AAoBO,UAAU,OAAA,CAChB,UACA,UAC+B,EAAA;AAC/B,EAAA,UAAA,GAAaA,mCAAe,UAAU,CAAA,CAAA;AAEtC,EAAA,IAAI,KAAQ,GAAA,CAAA,CAAA;AACZ,EAAW,KAAA,MAAA,KAAA,IAASC,yCAAmB,CAAA,QAAQ,CAAG,EAAA;AACjD,IAAA,OAAOA,yCAAmB,CAAA,UAAA,CAAW,KAAO,EAAA,KAAA,EAAO,CAAC,CAAA,CAAA;AAAA,GACrD;AACD,CAAA;AAViB,MAAA,CAAA,OAAA,EAAA,SAAA,CAAA","file":"flatMap.cjs","sourcesContent":["import type { IterableResolvable } from './from';\nimport { assertFunction } from './shared/_assertFunction';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Creates an iterable that yields the elements of each iterable returned by the provided function on each element of the input iterable.\n *\n * @param iterable An iterator to map.\n * @param callbackFn A function to execute for each element produced by the iterator. It should return an iterator or iterable that yields elements to be yielded by `flatMap()`, or a single non-iterator/iterable value to be yielded.\n * @returns An iterator that applies a function to each element of the input iterator and yields the results.\n *\n * @example\n * ```typescript\n * import { flatMap } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3];\n * console.log([...flatMap(iterable, (value) => [value, value * 2])]);\n * // Output: [1, 2, 2, 4, 3, 6]\n * ```\n */\nexport function* flatMap<const ElementType, const MappedType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => IterableResolvable<MappedType>\n): IterableIterator<MappedType> {\n\tcallbackFn = assertFunction(callbackFn);\n\n\tlet index = 0;\n\tfor (const value of toIterableIterator(iterable)) {\n\t\tyield* toIterableIterator(callbackFn(value, index++));\n\t}\n}\n"]}
@@ -15,5 +15,5 @@ function forEach(iterable, callbackFn) {
15
15
  __name(forEach, "forEach");
16
16
 
17
17
  exports.forEach = forEach;
18
- //# sourceMappingURL=out.js.map
18
+ //# sourceMappingURL=forEach.cjs.map
19
19
  //# sourceMappingURL=forEach.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/forEach.ts"],"names":[],"mappings":";;;;AACA,SAAS,sBAAsB;AAC/B,SAAS,0BAA0B;AAqB5B,SAAS,QACf,UACA,YACO;AACP,eAAa,eAAe,UAAU;AAEtC,MAAI,QAAQ;AACZ,aAAW,WAAW,mBAAmB,QAAQ,GAAG;AACnD,eAAW,SAAS,OAAO;AAAA,EAC5B;AACD;AAVgB","sourcesContent":["import type { IterableResolvable } from './from';\nimport { assertFunction } from './shared/_assertFunction';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Executes a provided function once for each iterable element.\n *\n * @param iterable An iterator to iterate over.\n * @param callbackFn A function to execute for each element produced by the iterator. Its return value is discarded.\n *\n * @example\n * ```typescript\n * import { forEach } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3, 4, 5];\n * forEach(iterable, (value) => console.log(value));\n * // Output: 1, 2, 3, 4, 5\n * ```\n *\n * @remarks\n *\n * This function consumes the entire iterator.\n */\nexport function forEach<const ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => void\n): void {\n\tcallbackFn = assertFunction(callbackFn);\n\n\tlet index = 0;\n\tfor (const element of toIterableIterator(iterable)) {\n\t\tcallbackFn(element, index++);\n\t}\n}\n"]}
1
+ {"version":3,"sources":["../../../src/lib/forEach.ts"],"names":["assertFunction","toIterableIterator"],"mappings":";;;;;;;AAuBO,SAAS,OAAA,CACf,UACA,UACO,EAAA;AACP,EAAA,UAAA,GAAaA,mCAAe,UAAU,CAAA,CAAA;AAEtC,EAAA,IAAI,KAAQ,GAAA,CAAA,CAAA;AACZ,EAAW,KAAA,MAAA,OAAA,IAAWC,yCAAmB,CAAA,QAAQ,CAAG,EAAA;AACnD,IAAA,UAAA,CAAW,SAAS,KAAO,EAAA,CAAA,CAAA;AAAA,GAC5B;AACD,CAAA;AAVgB,MAAA,CAAA,OAAA,EAAA,SAAA,CAAA","file":"forEach.cjs","sourcesContent":["import type { IterableResolvable } from './from';\nimport { assertFunction } from './shared/_assertFunction';\nimport { toIterableIterator } from './toIterableIterator';\n\n/**\n * Executes a provided function once for each iterable element.\n *\n * @param iterable An iterator to iterate over.\n * @param callbackFn A function to execute for each element produced by the iterator. Its return value is discarded.\n *\n * @example\n * ```typescript\n * import { forEach } from '@sapphire/iterator-utilities';\n *\n * const iterable = [1, 2, 3, 4, 5];\n * forEach(iterable, (value) => console.log(value));\n * // Output: 1, 2, 3, 4, 5\n * ```\n *\n * @remarks\n *\n * This function consumes the entire iterator.\n */\nexport function forEach<const ElementType>(\n\titerable: IterableResolvable<ElementType>,\n\tcallbackFn: (element: ElementType, index: number) => void\n): void {\n\tcallbackFn = assertFunction(callbackFn);\n\n\tlet index = 0;\n\tfor (const element of toIterableIterator(iterable)) {\n\t\tcallbackFn(element, index++);\n\t}\n}\n"]}
@@ -21,5 +21,5 @@ function from(value) {
21
21
  __name(from, "from");
22
22
 
23
23
  exports.from = from;
24
- //# sourceMappingURL=out.js.map
24
+ //# sourceMappingURL=from.cjs.map
25
25
  //# sourceMappingURL=from.cjs.map