Skip to content

Commit 65745f3

Browse files
authored
Upgrade deps and test on node 14 (#6)
- Add node 14 to the actions workflow for testing - Update api extractor and move back to a .json config file - Update tslint and prettier and fix issues therein - Update all warnings from api extractor, all external facing types are now exported BREAKING CHANGE: Renamed some type names that were previously unexpected but were used by exported functions. Fixed some exported type definitions to be more correct. Dropping node 8 and targeting Node 10/ES2018.
1 parent 5dce917 commit 65745f3

36 files changed

+1554
-532
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
node-version: [8.x, 10.x, 12.x]
10+
node-version: [10.x, 12.x, 14.x]
1111
steps:
1212
- uses: actions/checkout@v1
1313
- name: Use Node.js ${{ matrix.node-version }}

.npmignore

+3
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ rollup.config-esm.js
1212
rollup.config-umd.js
1313
budle-types.js
1414
dist/tsdoc-metadata.json
15+
SECURITY.md
16+
api-extractor.json
17+
.github

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ if ((Symbol as any).asyncIterator === undefined) {
7070

7171
### batch
7272
```ts
73-
function batch<T>(size: number, iterable: AsyncIterable<T>): AsyncIterableIterator<T[]>
74-
function batch<T>(size: number, iterable: Iterable<T>): IterableIterator<T[]>
73+
function batch<T>(size: number, iterable: AsyncIterable<T>): AsyncGenerator<T[]>
74+
function batch<T>(size: number, iterable: Iterable<T>): Generator<T[]>
7575
```
7676

7777
Batch objects from `iterable` into arrays of `size` length. The final array may be shorter than size if there is not enough items. Returns a sync iterator if the `iterable` is sync, otherwise an async iterator. Errors from the source `iterable` are immediately raised.
@@ -90,8 +90,8 @@ for await (const pokemons of batch(10, getPokemon())) {
9090

9191
### buffer
9292
```ts
93-
function buffer<T>(size: number, iterable: AsyncIterable<T>): AsyncIterableIterator<T>
94-
function buffer<T>(size: number, iterable: Iterable<T>): IterableIterator<T>
93+
function buffer<T>(size: number, iterable: AsyncIterable<T>): AsyncIterable<T>
94+
function buffer<T>(size: number, iterable: Iterable<T>): AsyncIterable<T>
9595
```
9696
Buffer keeps a number of objects in reserve available for immediate reading. This is helpful with async iterators as it will prefetch results so you don't have to wait for them to load. For sync iterables it will precompute up to `size` values and keep them in reserve. The internal buffer will start to be filled once `.next()` is called for the first time and will continue to fill until the source `iterable` is exhausted or the buffer is full. Errors from the source `iterable` will be raised after all buffered values are yielded.
9797

@@ -125,8 +125,8 @@ console.log(await collect(getPokemon()))
125125

126126
### concat
127127
```ts
128-
function concat(...iterables: Array<Iterable<any>>): IterableIterator<any>
129-
function concat(...iterables: Array<AnyIterable<any>>): AsyncIterableIterator<any>
128+
function concat(...iterables: Array<Iterable<any>>): Iterable<any>
129+
function concat(...iterables: Array<AnyIterable<any>>): AsyncIterable<any>
130130
```
131131

132132
Combine multiple iterators into a single iterable. Reads each iterable completely one at a time. Returns a sync iterator if all `iterables` are sync, otherwise it returns an async iterable. Errors from the source `iterable` are raised immediately.
@@ -163,7 +163,7 @@ await consume(train(getPokemon())) // load all the pokemon and train them!
163163

164164
### flatMap
165165
```ts
166-
function flatMap<T, B>(func: (data: T) => FlatMapValue<B>, iterable: AnyIterable<T>): AsyncIterableIterator<B>
166+
function flatMap<T, B>(func: (data: T) => FlatMapValue<B>, iterable: AnyIterable<T>): AsyncGenerator<B>
167167
```
168168

169169
Map `func` over the `iterable`, flatten the result and then ignore all null or undefined values. It's the transform function we've always needed. It's equivalent to;

0 commit comments

Comments
 (0)