@sapphire/iterator-utilities 1.0.1 → 1.0.2-next.0e5c61c4.0

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 (62) hide show
  1. package/README.md +81 -14
  2. package/dist/cjs/index.cjs +162 -162
  3. package/dist/cjs/index.cjs.map +1 -1
  4. package/dist/cjs/index.d.cts +1 -1
  5. package/dist/cjs/lib/append.cjs +2 -2
  6. package/dist/cjs/lib/at.cjs +6 -6
  7. package/dist/cjs/lib/average.cjs +3 -3
  8. package/dist/cjs/lib/chain.cjs +2 -2
  9. package/dist/cjs/lib/chunk.cjs +5 -5
  10. package/dist/cjs/lib/compact.cjs +2 -2
  11. package/dist/cjs/lib/compress.cjs +4 -4
  12. package/dist/cjs/lib/contains.cjs +2 -2
  13. package/dist/cjs/lib/count.cjs +2 -2
  14. package/dist/cjs/lib/cycle.cjs +2 -2
  15. package/dist/cjs/lib/difference.cjs +4 -4
  16. package/dist/cjs/lib/drop.cjs +7 -7
  17. package/dist/cjs/lib/dropLast.cjs +9 -9
  18. package/dist/cjs/lib/dropWhile.cjs +4 -4
  19. package/dist/cjs/lib/empty.cjs +2 -2
  20. package/dist/cjs/lib/enumerate.cjs +2 -2
  21. package/dist/cjs/lib/every.cjs +4 -4
  22. package/dist/cjs/lib/filter.cjs +4 -4
  23. package/dist/cjs/lib/find.cjs +3 -3
  24. package/dist/cjs/lib/findIndex.cjs +4 -4
  25. package/dist/cjs/lib/first.cjs +2 -2
  26. package/dist/cjs/lib/flat.cjs +3 -3
  27. package/dist/cjs/lib/flatMap.cjs +5 -5
  28. package/dist/cjs/lib/forEach.cjs +4 -4
  29. package/dist/cjs/lib/indexOf.cjs +2 -2
  30. package/dist/cjs/lib/intersect.cjs +4 -4
  31. package/dist/cjs/lib/isEmpty.cjs +2 -2
  32. package/dist/cjs/lib/last.cjs +2 -2
  33. package/dist/cjs/lib/map.cjs +4 -4
  34. package/dist/cjs/lib/max.cjs +3 -3
  35. package/dist/cjs/lib/min.cjs +3 -3
  36. package/dist/cjs/lib/partition.cjs +4 -4
  37. package/dist/cjs/lib/peekable.cjs +2 -2
  38. package/dist/cjs/lib/prepend.cjs +3 -3
  39. package/dist/cjs/lib/product.cjs +3 -3
  40. package/dist/cjs/lib/range.cjs +4 -4
  41. package/dist/cjs/lib/reduce.cjs +4 -4
  42. package/dist/cjs/lib/repeat.cjs +5 -5
  43. package/dist/cjs/lib/reverse.cjs +2 -2
  44. package/dist/cjs/lib/shared/_toIntegerOrInfinityOrThrow.cjs +2 -2
  45. package/dist/cjs/lib/shared/_toIntegerOrThrow.cjs +2 -2
  46. package/dist/cjs/lib/slice.cjs +16 -16
  47. package/dist/cjs/lib/some.cjs +4 -4
  48. package/dist/cjs/lib/sorted.cjs +2 -2
  49. package/dist/cjs/lib/starMap.cjs +6 -6
  50. package/dist/cjs/lib/sum.cjs +3 -3
  51. package/dist/cjs/lib/take.cjs +9 -9
  52. package/dist/cjs/lib/takeLast.cjs +11 -11
  53. package/dist/cjs/lib/tee.cjs +10 -10
  54. package/dist/cjs/lib/toArray.cjs +2 -2
  55. package/dist/cjs/lib/toIterableIterator.cjs +4 -4
  56. package/dist/cjs/lib/union.cjs +2 -2
  57. package/dist/cjs/lib/unique.cjs +2 -2
  58. package/dist/cjs/lib/unzip.cjs +2 -2
  59. package/dist/cjs/lib/zip.cjs +2 -2
  60. package/dist/esm/index.d.mts +1 -1
  61. package/dist/esm/index.mjs.map +1 -1
  62. package/package.json +7 -7
package/README.md CHANGED
@@ -18,16 +18,63 @@
18
18
  - [Features](#features)
19
19
  - [Installation](#installation)
20
20
  - [Usage](#usage)
21
- - [Resolving](#resolving)
22
- - [Checking for the existence of any bit](#checking-for-the-existence-of-any-bit)
23
- - [Checking for the existence of one or multiple bits](#checking-for-the-existence-of-one-or-multiple-bits)
24
- - [Getting the field's complement](#getting-the-fields-complement)
25
- - [Getting the union of different fields](#getting-the-union-of-different-fields)
26
- - [Getting the intersection between different fields](#getting-the-intersection-between-different-fields)
27
- - [Getting the symmetric difference between different fields](#getting-the-symmetric-difference-between-different-fields)
28
- - [Formatting a field](#formatting-a-field)
21
+ - [`append`](#append)
22
+ - [`at`](#at)
23
+ - [`average`](#average)
24
+ - [`chain`](#chain)
25
+ - [`chunk`](#chunk)
26
+ - [`compact`](#compact)
27
+ - [`compress`](#compress)
28
+ - [`contains`](#contains)
29
+ - [`count`](#count)
30
+ - [`cycle`](#cycle)
31
+ - [`difference`](#difference)
32
+ - [`drop`](#drop)
33
+ - [`dropLast`](#droplast)
34
+ - [`dropWhile`](#dropwhile)
35
+ - [`empty`](#empty)
36
+ - [`enumerate`](#enumerate)
37
+ - [`every`](#every)
38
+ - [`filter`](#filter)
39
+ - [`find`](#find)
40
+ - [`findIndex`](#findindex)
41
+ - [`first`](#first)
42
+ - [`flat`](#flat)
43
+ - [`flatMap`](#flatmap)
44
+ - [`forEach`](#foreach)
45
+ - [`from`](#from)
46
+ - [`indexOf`](#indexof)
47
+ - [`intersect`](#intersect)
48
+ - [`isEmpty`](#isempty)
49
+ - [`last`](#last)
50
+ - [`map`](#map)
51
+ - [`max`](#max)
52
+ - [`min`](#min)
53
+ - [`partition`](#partition)
54
+ - [`peekable`](#peekable)
55
+ - [`prepend`](#prepend)
56
+ - [`product`](#product)
57
+ - [`range`](#range)
58
+ - [`reduce`](#reduce)
59
+ - [`repeat`](#repeat)
60
+ - [`reverse`](#reverse)
61
+ - [`slice`](#slice)
62
+ - [`some`](#some)
63
+ - [`sorted`](#sorted)
64
+ - [`starMap`](#starmap)
65
+ - [`sum`](#sum)
66
+ - [`take`](#take)
67
+ - [`takeLast`](#takelast)
68
+ - [`takeWhile`](#takewhile)
69
+ - [`tee`](#tee)
70
+ - [`toArray`](#toarray)
71
+ - [`toIterableIterator`](#toiterableiterator)
72
+ - [`union`](#union)
73
+ - [`unique`](#unique)
74
+ - [`unzip`](#unzip)
75
+ - [`zip`](#zip)
29
76
  - [Buy us some doughnuts](#buy-us-some-doughnuts)
30
- - [Contributors](#contributors-)
77
+ - [Contributors](#contributors)
31
78
 
32
79
  ## Features
33
80
 
@@ -284,7 +331,11 @@ console.log(first(iterable));
284
331
  Creates an iterable that yields the elements of each iterable in the input iterable.
285
332
 
286
333
  ```typescript
287
- const iterable = flat([[1, 2], [3, 4], [5, 6]]);
334
+ const iterable = flat([
335
+ [1, 2],
336
+ [3, 4],
337
+ [5, 6]
338
+ ]);
288
339
  console.log([...iterable]);
289
340
  // Output: [1, 2, 3, 4, 5, 6]
290
341
  ```
@@ -577,7 +628,11 @@ console.log([...sorted(iterable)]);
577
628
  Creates an iterable with the results of calling a provided function on each element of the input iterables as the function's parameters.
578
629
 
579
630
  ```typescript
580
- const iterable = [[1, 2], [3, 4], [5, 6]];
631
+ const iterable = [
632
+ [1, 2],
633
+ [3, 4],
634
+ [5, 6]
635
+ ];
581
636
  console.log([...starMap(iterable, (a, b) => a + b)]);
582
637
  // Output: [3, 7, 11]
583
638
  ```
@@ -648,7 +703,11 @@ console.log(toArray(set));
648
703
  ```
649
704
 
650
705
  ```typescript
651
- const map = new Map([['a', 1], ['b', 2], ['c', 3]]);
706
+ const map = new Map([
707
+ ['a', 1],
708
+ ['b', 2],
709
+ ['c', 3]
710
+ ]);
652
711
  console.log(toArray(map));
653
712
  // Output: [['a', 1], ['b', 2], ['c', 3]]
654
713
  ```
@@ -676,7 +735,11 @@ console.log([...toIterableIterator(set)]);
676
735
  ```
677
736
 
678
737
  ```typescript
679
- const map = new Map([['a', 1], ['b', 2], ['c', 3]]);
738
+ const map = new Map([
739
+ ['a', 1],
740
+ ['b', 2],
741
+ ['c', 3]
742
+ ]);
680
743
  console.log([...toIterableIterator(map)]);
681
744
  // Output: [['a', 1], ['b', 2], ['c', 3]]
682
745
  ```
@@ -713,7 +776,11 @@ console.log([...unique(iterable)]);
713
776
  Creates an array for each element of the input iterable, transposing the input iterable. The opposite of [`zip`](#zip).
714
777
 
715
778
  ```typescript
716
- const iterable = [[1, 'a'], [2, 'b'], [3, 'c']];
779
+ const iterable = [
780
+ [1, 'a'],
781
+ [2, 'b'],
782
+ [3, 'c']
783
+ ];
717
784
  const [numbers, letters] = unzip(iterable);
718
785
 
719
786
  console.log(numbers);