@@ -24,27 +24,25 @@ A collection of array-related async utilities.
2424* [` asyncSome()` ](#asyncSome)
2525* [` asyncSomeStrict()` ](#asyncSomeStrict)
2626
27- ### General utils
28-
29- #### ` asyncEvery()`
27+ ### ` asyncEvery()`
3028
3129Tests whether all elements in the array pass the test implemented by the provided asynchronous function . It returns a Boolean value.
3230
33- ##### Sample usage
31+ #### Sample usage
3432
3533```js
3634import { asyncEvery } from '@wojtekmaj/async-array-utils';
3735
3836const largerThanZero = await asyncEvery ([1 , 2 , 3 ], async (el , index ) => el > 0 ); // true
3937```
4038
41- #### `asyncForEach()`
39+ ### `asyncForEach()`
4240
4341Executes a provided asynchronous function once for each array element.
4442
4543Note: For optimization purposes, all iterations are ran concurrently. If you rely on any side effects, consider `asyncForEachStrict()` instead.
4644
47- ##### Sample usage
45+ #### Sample usage
4846
4947```js
5048import { asyncForEach } from ' @wojtekmaj/async-array-utils' ;
@@ -55,11 +53,11 @@ await asyncForEach(
5553); // undefined; 3 console.logs
5654```
5755
58- #### ` asyncForEachStrict() `
56+ ### ` asyncForEachStrict() `
5957
6058Like ` asyncForEach() ` , but runs iterations non-concurrently.
6159
62- ##### Sample usage
60+ #### Sample usage
6361
6462``` js
6563import { asyncForEachStrict } from ' @wojtekmaj/async-array-utils' ;
@@ -72,25 +70,25 @@ await asyncForEachStrict(
7270console .log (indexes); // [0, 1, 2]
7371```
7472
75- #### ` asyncMap() `
73+ ### ` asyncMap() `
7674
7775Creates a new array populated with the results of calling a provided asynchronous function on every element in the calling array.
7876
7977Note: For optimization purposes, all iterations are ran concurrently. If you rely on any side effects, consider ` asyncMapStrict() ` instead.
8078
81- ##### Sample usage
79+ #### Sample usage
8280
8381``` js
8482import { asyncMap } from ' @wojtekmaj/async-array-utils' ;
8583
8684const asyncMappedArr = await asyncMap ([1 , 2 , 3 ], async (el , index ) => el * 2 ); // [2, 4, 6]
8785```
8886
89- #### ` asyncMapStrict() `
87+ ### ` asyncMapStrict() `
9088
9189Like ` asyncMap() ` , but runs iterations non-concurrently.
9290
93- ##### Sample usage
91+ #### Sample usage
9492
9593``` js
9694import { asyncMapStrict } from ' @wojtekmaj/async-array-utils' ;
@@ -100,11 +98,11 @@ await asyncMapStrict([1, 2, 3], async (el, index) => { indexes.push(index); retu
10098console .log (indexes); // [0, 1, 2]
10199```
102100
103- #### ` asyncReduce() `
101+ ### ` asyncReduce() `
104102
105103Executes a reducer asynchronous function (that you provide) on each element of the array, resulting in a single output value.
106104
107- ##### Sample usage
105+ #### Sample usage
108106
109107``` js
110108import { asyncReduce } from ' @wojtekmaj/async-array-utils' ;
@@ -116,25 +114,25 @@ const result = await asyncReduce(
116114); // 6
117115```
118116
119- #### ` asyncSome() `
117+ ### ` asyncSome() `
120118
121119Tests whether at least one element in the array pass the test implemented by the provided asynchronous function. It returns a Boolean value.
122120
123121Note: For optimization purposes, all iterations are ran concurrently. If you rely on any side effects or execution order, consider ` asyncMapStrict() ` instead.
124122
125- ##### Sample usage
123+ #### Sample usage
126124
127125``` js
128126import { asyncSome } from ' @wojtekmaj/async-array-utils' ;
129127
130128const largerThanZero = await asyncSome ([1 , 2 , 3 ], async (el , index ) => el > 0 ); // true
131129```
132130
133- #### ` asyncSomeStrict() `
131+ ### ` asyncSomeStrict() `
134132
135133Like ` asyncSome() ` , but runs iterations non-concurrently.
136134
137- ##### Sample usage
135+ #### Sample usage
138136
139137``` js
140138import { asyncSomeStrict } from ' @wojtekmaj/async-array-utils' ;
0 commit comments