Skip to content

Commit 1b5b316

Browse files
committed
Use TypeScript in all README examples
1 parent a64790d commit 1b5b316

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ A collection of array-related async utilities.
99
- Install by executing `npm install @wojtekmaj/async-array-utils` or `yarn add @wojtekmaj/async-array-utils`.
1010
- Import by adding `import * as asyncArrayUtils from '@wojtekmaj/async-array-utils'`.
1111
- Do stuff with it!
12-
```js
12+
```ts
1313
const asyncMappedArr = await asyncMap([1, 2, 3], async (x) => x * 2);
1414
```
1515

@@ -39,7 +39,7 @@ Note: For optimization purposes, all iterations are ran concurrently. If you rel
3939

4040
#### Sample usage
4141

42-
```js
42+
```ts
4343
import { asyncEvery } from '@wojtekmaj/async-array-utils';
4444

4545
const largerThanZero = await asyncEvery([1, 2, 3], async (el) => el > 0); // true
@@ -51,7 +51,7 @@ Like `asyncEvery()`, but runs iterations non-concurrently.
5151

5252
#### Sample usage
5353

54-
```js
54+
```ts
5555
import { asyncEveryStrict } from '@wojtekmaj/async-array-utils';
5656

5757
const indexes = [];
@@ -70,7 +70,7 @@ Note: For optimization purposes, all iterations are ran concurrently. If you rel
7070

7171
#### Sample usage
7272

73-
```js
73+
```ts
7474
import { asyncFilter } from '@wojtekmaj/async-array-utils';
7575

7676
const asyncFilteredArr = await asyncFilter([1, 2, 3], async (el) => el > 1); // [2, 3]
@@ -82,7 +82,7 @@ Like `asyncFilter()`, but runs iterations non-concurrently.
8282

8383
#### Sample usage
8484

85-
```js
85+
```ts
8686
import { asyncFilterStrict } from '@wojtekmaj/async-array-utils';
8787

8888
const indexes = [];
@@ -99,7 +99,7 @@ Returns the first element in the provided array that satisfies the provided test
9999

100100
#### Sample usage
101101

102-
```js
102+
```ts
103103
import { asyncFind } from '@wojtekmaj/async-array-utils';
104104

105105
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
111111

112112
#### Sample usage
113113

114-
```js
114+
```ts
115115
import { asyncFindIndex } from '@wojtekmaj/async-array-utils';
116116

117117
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
125125

126126
#### Sample usage
127127

128-
```js
128+
```ts
129129
import { asyncForEach } from '@wojtekmaj/async-array-utils';
130130

131131
await asyncForEach([1, 2, 3], async (el) => {
@@ -139,7 +139,7 @@ Like `asyncForEach()`, but runs iterations non-concurrently.
139139

140140
#### Sample usage
141141

142-
```js
142+
```ts
143143
import { asyncForEachStrict } from '@wojtekmaj/async-array-utils';
144144

145145
const indexes = [];
@@ -158,7 +158,7 @@ Note: For optimization purposes, all iterations are ran concurrently. If you rel
158158

159159
#### Sample usage
160160

161-
```js
161+
```ts
162162
import { asyncMap } from '@wojtekmaj/async-array-utils';
163163

164164
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.
170170

171171
#### Sample usage
172172

173-
```js
173+
```ts
174174
import { asyncMapStrict } from '@wojtekmaj/async-array-utils';
175175

176176
const indexes = [];
@@ -187,7 +187,7 @@ Executes a reducer asynchronous function (that you provide) on each element of t
187187

188188
#### Sample usage
189189

190-
```js
190+
```ts
191191
import { asyncReduce } from '@wojtekmaj/async-array-utils';
192192

193193
const result = await asyncReduce(
@@ -207,7 +207,7 @@ Note: For optimization purposes, all iterations are ran concurrently. If you rel
207207

208208
#### Sample usage
209209

210-
```js
210+
```ts
211211
import { asyncSome } from '@wojtekmaj/async-array-utils';
212212

213213
const largerThanZero = await asyncSome([1, 2, 3], async (el) => el > 0); // true
@@ -219,7 +219,7 @@ Like `asyncSome()`, but runs iterations non-concurrently.
219219

220220
#### Sample usage
221221

222-
```js
222+
```ts
223223
import { asyncSomeStrict } from '@wojtekmaj/async-array-utils';
224224

225225
const indexes = [];

0 commit comments

Comments
 (0)