@@ -9,7 +9,7 @@ A collection of array-related async utilities.
9
9
- Install by executing ` npm install @wojtekmaj/async-array-utils ` or ` yarn add @wojtekmaj/async-array-utils ` .
10
10
- Import by adding ` import * as asyncArrayUtils from '@wojtekmaj/async-array-utils' ` .
11
11
- Do stuff with it!
12
- ``` js
12
+ ``` ts
13
13
const asyncMappedArr = await asyncMap ([1 , 2 , 3 ], async (x ) => x * 2 );
14
14
```
15
15
@@ -39,7 +39,7 @@ Note: For optimization purposes, all iterations are ran concurrently. If you rel
39
39
40
40
#### Sample usage
41
41
42
- ``` js
42
+ ``` ts
43
43
import { asyncEvery } from ' @wojtekmaj/async-array-utils' ;
44
44
45
45
const largerThanZero = await asyncEvery ([1 , 2 , 3 ], async (el ) => el > 0 ); // true
@@ -51,7 +51,7 @@ Like `asyncEvery()`, but runs iterations non-concurrently.
51
51
52
52
#### Sample usage
53
53
54
- ``` js
54
+ ``` ts
55
55
import { asyncEveryStrict } from ' @wojtekmaj/async-array-utils' ;
56
56
57
57
const indexes = [];
@@ -70,7 +70,7 @@ Note: For optimization purposes, all iterations are ran concurrently. If you rel
70
70
71
71
#### Sample usage
72
72
73
- ``` js
73
+ ``` ts
74
74
import { asyncFilter } from ' @wojtekmaj/async-array-utils' ;
75
75
76
76
const asyncFilteredArr = await asyncFilter ([1 , 2 , 3 ], async (el ) => el > 1 ); // [2, 3]
@@ -82,7 +82,7 @@ Like `asyncFilter()`, but runs iterations non-concurrently.
82
82
83
83
#### Sample usage
84
84
85
- ``` js
85
+ ``` ts
86
86
import { asyncFilterStrict } from ' @wojtekmaj/async-array-utils' ;
87
87
88
88
const indexes = [];
@@ -99,7 +99,7 @@ Returns the first element in the provided array that satisfies the provided test
99
99
100
100
#### Sample usage
101
101
102
- ``` js
102
+ ``` ts
103
103
import { asyncFind } from ' @wojtekmaj/async-array-utils' ;
104
104
105
105
const asyncFoundEl = await asyncFind ([1 , 2 , 3 ], async (el ) => el > 1 ); // 2
@@ -111,7 +111,7 @@ Returns the index of the first element in an array that satisfies the provided t
111
111
112
112
#### Sample usage
113
113
114
- ``` js
114
+ ``` ts
115
115
import { asyncFindIndex } from ' @wojtekmaj/async-array-utils' ;
116
116
117
117
const asyncFoundIndex = await asyncFindIndex ([1 , 2 , 3 ], async (el ) => el > 1 ); // 1
@@ -125,7 +125,7 @@ Note: For optimization purposes, all iterations are ran concurrently. If you rel
125
125
126
126
#### Sample usage
127
127
128
- ``` js
128
+ ``` ts
129
129
import { asyncForEach } from ' @wojtekmaj/async-array-utils' ;
130
130
131
131
await asyncForEach ([1 , 2 , 3 ], async (el ) => {
@@ -139,7 +139,7 @@ Like `asyncForEach()`, but runs iterations non-concurrently.
139
139
140
140
#### Sample usage
141
141
142
- ``` js
142
+ ``` ts
143
143
import { asyncForEachStrict } from ' @wojtekmaj/async-array-utils' ;
144
144
145
145
const indexes = [];
@@ -158,7 +158,7 @@ Note: For optimization purposes, all iterations are ran concurrently. If you rel
158
158
159
159
#### Sample usage
160
160
161
- ``` js
161
+ ``` ts
162
162
import { asyncMap } from ' @wojtekmaj/async-array-utils' ;
163
163
164
164
const asyncMappedArr = await asyncMap ([1 , 2 , 3 ], async (el ) => el * 2 ); // [2, 4, 6]
@@ -170,7 +170,7 @@ Like `asyncMap()`, but runs iterations non-concurrently.
170
170
171
171
#### Sample usage
172
172
173
- ``` js
173
+ ``` ts
174
174
import { asyncMapStrict } from ' @wojtekmaj/async-array-utils' ;
175
175
176
176
const indexes = [];
@@ -187,7 +187,7 @@ Executes a reducer asynchronous function (that you provide) on each element of t
187
187
188
188
#### Sample usage
189
189
190
- ``` js
190
+ ``` ts
191
191
import { asyncReduce } from ' @wojtekmaj/async-array-utils' ;
192
192
193
193
const result = await asyncReduce (
@@ -207,7 +207,7 @@ Note: For optimization purposes, all iterations are ran concurrently. If you rel
207
207
208
208
#### Sample usage
209
209
210
- ``` js
210
+ ``` ts
211
211
import { asyncSome } from ' @wojtekmaj/async-array-utils' ;
212
212
213
213
const largerThanZero = await asyncSome ([1 , 2 , 3 ], async (el ) => el > 0 ); // true
@@ -219,7 +219,7 @@ Like `asyncSome()`, but runs iterations non-concurrently.
219
219
220
220
#### Sample usage
221
221
222
- ``` js
222
+ ``` ts
223
223
import { asyncSomeStrict } from ' @wojtekmaj/async-array-utils' ;
224
224
225
225
const indexes = [];
0 commit comments