Skip to content

Commit

Permalink
Package size optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
Smoren committed Mar 3, 2024
1 parent e0fd76a commit ea0dc1f
Show file tree
Hide file tree
Showing 6 changed files with 2,262 additions and 54 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# IterTools Typescript Change Log

## v1.27.1 - 2024-03-03

Package Size Optimization.

## v1.27.0 - 2023-11-13

### New features
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "itertools-ts",
"version": "1.27.0",
"version": "1.27.1",
"description": "Extended itertools port for TypeScript and JavaScript. Provides a huge set of functions for working with iterable collections (including async ones)",
"license": "MIT",
"repository": {
Expand Down Expand Up @@ -32,8 +32,7 @@
"es",
"lib",
"src",
"tests/stream",
"tests/async-stream",
"tests/examples",
"tests/fixture.ts",
"tests/tools"
],
Expand Down
2 changes: 1 addition & 1 deletion src/async-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ export class AsyncStream {
*
* @see summary.exactlyNAsync
*/
async exactlyNAsync(
async exactlyN(
n: number,
predicate?: (item: unknown) => Promise<boolean> | boolean
): Promise<boolean> {
Expand Down
100 changes: 50 additions & 50 deletions tests/async-stream/summary.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,17 @@ function dataProviderForArraysTrue(): Array<unknown> {
[
[],
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(0),
.exactlyN(0),
],
[
[''],
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(0),
.exactlyN(0),
],
[
[1, 3, 5],
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(3),
.exactlyN(3),
],
[
[1, -1, 2, -2, 3, -3],
Expand Down Expand Up @@ -226,17 +226,17 @@ function dataProviderForGeneratorsTrue(): Array<unknown> {
[
createGeneratorFixture([]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(0),
.exactlyN(0),
],
[
createGeneratorFixture(['']),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(0),
.exactlyN(0),
],
[
createGeneratorFixture([1, 3, 5]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(3),
.exactlyN(3),
],
[
createGeneratorFixture([1, -1, 2, -2, 3, -3]),
Expand Down Expand Up @@ -341,17 +341,17 @@ function dataProviderForIterablesTrue(): Array<unknown> {
[
createIterableFixture([]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(0),
.exactlyN(0),
],
[
createIterableFixture(['']),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(0),
.exactlyN(0),
],
[
createIterableFixture([1, 3, 5]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(3),
.exactlyN(3),
],
[
createIterableFixture([1, -1, 2, -2, 3, -3]),
Expand Down Expand Up @@ -456,17 +456,17 @@ function dataProviderForIteratorsTrue(): Array<unknown> {
[
createIteratorFixture([]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(0),
.exactlyN(0),
],
[
createIteratorFixture(['']),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(0),
.exactlyN(0),
],
[
createIteratorFixture([1, 3, 5]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(3),
.exactlyN(3),
],
[
createIteratorFixture([1, -1, 2, -2, 3, -3]),
Expand Down Expand Up @@ -566,7 +566,7 @@ function dataProviderForStringsTrue(): Array<unknown> {
[
'',
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(0),
.exactlyN(0),
],
[
'123',
Expand Down Expand Up @@ -679,17 +679,17 @@ function dataProviderForSetsTrue(): Array<unknown> {
[
new Set([]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(0),
.exactlyN(0),
],
[
new Set(['']),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(0),
.exactlyN(0),
],
[
new Set([1, 3, 5]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(3),
.exactlyN(3),
],
[
new Set([1, -1, 2, -2, 3, -3]),
Expand Down Expand Up @@ -906,17 +906,17 @@ function dataProviderForAsyncGeneratorsTrue(): Array<unknown> {
[
createAsyncGeneratorFixture([]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(0),
.exactlyN(0),
],
[
createAsyncGeneratorFixture(['']),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(0),
.exactlyN(0),
],
[
createAsyncGeneratorFixture([1, 3, 5]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(3),
.exactlyN(3),
],
[
createAsyncGeneratorFixture([1, -1, 2, -2, 3, -3]),
Expand Down Expand Up @@ -1030,17 +1030,17 @@ function dataProviderForAsyncIterablesTrue(): Array<unknown> {
[
createAsyncIterableFixture([]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(0),
.exactlyN(0),
],
[
createAsyncIterableFixture(['']),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(0),
.exactlyN(0),
],
[
createAsyncIterableFixture([1, 3, 5]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(3),
.exactlyN(3),
],
[
createAsyncIterableFixture([1, -1, 2, -2, 3, -3]),
Expand Down Expand Up @@ -1154,17 +1154,17 @@ function dataProviderForAsyncIteratorsTrue(): Array<unknown> {
[
createAsyncIteratorFixture([]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(0),
.exactlyN(0),
],
[
createAsyncIteratorFixture(['']),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(0),
.exactlyN(0),
],
[
createAsyncIteratorFixture([1, 3, 5]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(3),
.exactlyN(3),
],
[
createAsyncIteratorFixture([1, -1, 2, -2, 3, -3]),
Expand Down Expand Up @@ -1257,17 +1257,17 @@ function dataProviderForArraysFalse(): Array<unknown> {
[
[],
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(1),
.exactlyN(1),
],
[
[''],
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(1),
.exactlyN(1),
],
[
[1, 3, 5],
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(4),
.exactlyN(4),
],
[
[1, -1, 2, -2, 3, -3],
Expand Down Expand Up @@ -1345,17 +1345,17 @@ function dataProviderForGeneratorsFalse(): Array<unknown> {
[
createGeneratorFixture([]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(1),
.exactlyN(1),
],
[
createGeneratorFixture(['']),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(1),
.exactlyN(1),
],
[
createGeneratorFixture([1, 3, 5]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(4),
.exactlyN(4),
],
[
createGeneratorFixture([1, -1, 2, -2, 3, -3]),
Expand Down Expand Up @@ -1433,17 +1433,17 @@ function dataProviderForIterablesFalse(): Array<unknown> {
[
createIterableFixture([]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(1),
.exactlyN(1),
],
[
createIterableFixture(['']),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(1),
.exactlyN(1),
],
[
createIterableFixture([1, 3, 5]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(4),
.exactlyN(4),
],
[
createIterableFixture([1, -1, 2, -2, 3, -3]),
Expand Down Expand Up @@ -1521,17 +1521,17 @@ function dataProviderForIteratorsFalse(): Array<unknown> {
[
createIteratorFixture([]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(1),
.exactlyN(1),
],
[
createIteratorFixture(['']),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(1),
.exactlyN(1),
],
[
createIteratorFixture([1, 3, 5]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(4),
.exactlyN(4),
],
[
createIteratorFixture([1, -1, 2, -2, 3, -3]),
Expand Down Expand Up @@ -1609,7 +1609,7 @@ function dataProviderForStringsFalse(): Array<unknown> {
[
'',
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(1),
.exactlyN(1),
],
[
'131',
Expand Down Expand Up @@ -1686,17 +1686,17 @@ function dataProviderForSetsFalse(): Array<unknown> {
[
new Set([]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(1),
.exactlyN(1),
],
[
new Set(['']),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(1),
.exactlyN(1),
],
[
new Set([1, 3, 5]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(4),
.exactlyN(4),
],
[
new Set([1, -1, 2, -2, 3, -3]),
Expand Down Expand Up @@ -1860,17 +1860,17 @@ function dataProviderForAsyncGeneratorsFalse(): Array<unknown> {
[
createAsyncGeneratorFixture([]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(1),
.exactlyN(1),
],
[
createAsyncGeneratorFixture(['']),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(1),
.exactlyN(1),
],
[
createAsyncGeneratorFixture([1, 3, 5]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(4),
.exactlyN(4),
],
[
createAsyncGeneratorFixture([1, -1, 2, -2, 3, -3]),
Expand Down Expand Up @@ -1957,17 +1957,17 @@ function dataProviderForAsyncIterablesFalse(): Array<unknown> {
[
createAsyncIterableFixture([]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(1),
.exactlyN(1),
],
[
createAsyncIterableFixture(['']),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(1),
.exactlyN(1),
],
[
createAsyncIterableFixture([1, 3, 5]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(4),
.exactlyN(4),
],
[
createAsyncIterableFixture([1, -1, 2, -2, 3, -3]),
Expand Down Expand Up @@ -2054,17 +2054,17 @@ function dataProviderForAsyncIteratorsFalse(): Array<unknown> {
[
createAsyncIteratorFixture([]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(1),
.exactlyN(1),
],
[
createAsyncIteratorFixture(['']),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(1),
.exactlyN(1),
],
[
createAsyncIteratorFixture([1, 3, 5]),
(iterable: Iterable<unknown>) => AsyncStream.of(iterable)
.exactlyNAsync(4),
.exactlyN(4),
],
[
createAsyncIteratorFixture([1, -1, 2, -2, 3, -3]),
Expand Down
Loading

0 comments on commit ea0dc1f

Please sign in to comment.