Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@
"name": "@wojtekmaj/async-array-utils",
"version": "1.7.0",
"description": "A collection of array-related async utilities.",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"source": "src/index.ts",
"types": "dist/cjs/index.d.ts",
"type": "module",
"sideEffects": false,
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"source": "./src/index.ts",
"types": "./dist/cjs/index.d.ts",
"exports": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
},
"scripts": {
"build": "yarn build-esm && yarn build-cjs",
"build": "yarn build-esm && yarn build-cjs && yarn build-cjs-package",
"build-esm": "tsc --project tsconfig.build.json --outDir dist/esm --module esnext",
"build-cjs": "tsc --project tsconfig.build.json --outDir dist/cjs --module commonjs",
"build-cjs-package": "echo '{\n \"type\": \"commonjs\"\n}' > dist/cjs/package.json",
"clean": "rimraf dist",
"lint": "eslint .",
"postinstall": "husky install",
Expand Down
4 changes: 2 additions & 2 deletions src/every.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import asyncEvery from './every';
import asyncEvery from './every.js';

import {
getTimer,
Expand All @@ -8,7 +8,7 @@ import {
largerThanOneHundredInRandomTime,
makeDelayed,
throws,
} from '../test-utils';
} from '../test-utils.js';

function largerOrEqualThanZero(x: number) {
return x >= 0;
Expand Down
2 changes: 1 addition & 1 deletion src/every.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import asyncForEach from './forEach';
import asyncForEach from './forEach.js';

function asyncEvery<T>(
arr: T[],
Expand Down
4 changes: 2 additions & 2 deletions src/every_strict.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import asyncEveryStrict from './every_strict';
import asyncEveryStrict from './every_strict.js';

import {
doubleInputArr,
Expand All @@ -11,7 +11,7 @@ import {
makePushDuplicate,
makePushDuplicateInRandomTime,
throws,
} from '../test-utils';
} from '../test-utils.js';

function largerOrEqualThanZero(x: number) {
return x >= 0;
Expand Down
2 changes: 1 addition & 1 deletion src/every_strict.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import asyncForEachStrict from './forEach_strict';
import asyncForEachStrict from './forEach_strict.js';

function asyncEveryStrict<T>(
arr: T[],
Expand Down
4 changes: 2 additions & 2 deletions src/filter.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import asyncFilter from './filter';
import asyncFilter from './filter.js';

import {
getTimer,
Expand All @@ -8,7 +8,7 @@ import {
largerThanTwoInRandomTime,
makeDelayed,
throws,
} from '../test-utils';
} from '../test-utils.js';

describe('asyncFilter()', () => {
it('example from README works as described', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/filter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import asyncForEach from './forEach';
import asyncForEach from './forEach.js';

function asyncFilter<T>(
arr: T[],
Expand Down
4 changes: 2 additions & 2 deletions src/filter_strict.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import asyncFilterStrict from './filter_strict';
import asyncFilterStrict from './filter_strict.js';

import {
doubleInputArr,
Expand All @@ -11,7 +11,7 @@ import {
makePushDuplicate,
makePushDuplicateInRandomTime,
throws,
} from '../test-utils';
} from '../test-utils.js';

describe('asyncFilterStrict()', () => {
it('example from README works as described', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/filter_strict.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import asyncForEachStrict from './forEach_strict';
import asyncForEachStrict from './forEach_strict.js';

function asyncFilterStrict<T>(
arr: T[],
Expand Down
4 changes: 2 additions & 2 deletions src/find.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import asyncFind from './find';
import asyncFind from './find.js';

import {
getTimer,
Expand All @@ -10,7 +10,7 @@ import {
largerThanTwoInRandomTime,
makeDelayed,
throws,
} from '../test-utils';
} from '../test-utils.js';

const firstElementLargerThanTwo = inputArr.findIndex(largerThanTwo);

Expand Down
2 changes: 1 addition & 1 deletion src/find.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import asyncForEachStrict from './forEach_strict';
import asyncForEachStrict from './forEach_strict.js';

function asyncFind<T>(
arr: T[],
Expand Down
4 changes: 2 additions & 2 deletions src/findIndex.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import asyncFindIndex from './findIndex';
import asyncFindIndex from './findIndex.js';

import {
getTimer,
Expand All @@ -10,7 +10,7 @@ import {
largerThanTwoInRandomTime,
makeDelayed,
throws,
} from '../test-utils';
} from '../test-utils.js';

const firstElementLargerThanTwo = inputArr.findIndex(largerThanTwo);

Expand Down
2 changes: 1 addition & 1 deletion src/findIndex.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import asyncForEachStrict from './forEach_strict';
import asyncForEachStrict from './forEach_strict.js';

function asyncFindIndex<T>(
arr: T[],
Expand Down
4 changes: 2 additions & 2 deletions src/forEach.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import asyncForEach from './forEach';
import asyncForEach from './forEach.js';

import {
getTimer,
Expand All @@ -8,7 +8,7 @@ import {
makePushDuplicate,
makePushDuplicateInRandomTime,
throws,
} from '../test-utils';
} from '../test-utils.js';

describe('asyncForEach()', () => {
it('example from README works as described', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/forEach.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import asyncMap from './map';
import asyncMap from './map.js';

export default function asyncForEach<T, U>(
arr: T[],
Expand Down
4 changes: 2 additions & 2 deletions src/forEach_strict.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import asyncForEachStrict from './forEach_strict';
import asyncForEachStrict from './forEach_strict.js';
import {
doubleInputArr,
getTimer,
Expand All @@ -8,7 +8,7 @@ import {
makePushDuplicate,
makePushDuplicateInRandomTime,
throws,
} from '../test-utils';
} from '../test-utils.js';

describe('asyncForEachStrict()', () => {
it('example from README works as described', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/forEach_strict.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import asyncMapStrict from './map_strict';
import asyncMapStrict from './map_strict.js';

export default function asyncForEachStrict<T, U>(
arr: T[],
Expand Down
2 changes: 1 addition & 1 deletion src/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
asyncReduce,
asyncSome,
asyncSomeStrict,
} from './index';
} from './index.js';

describe('index', () => {
it('has asyncFilter exported properly', () => {
Expand Down
26 changes: 13 additions & 13 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import asyncFilter from './filter';
import asyncFilterStrict from './filter_strict';
import asyncFind from './find';
import asyncFindIndex from './findIndex';
import asyncForEach from './forEach';
import asyncForEachStrict from './forEach_strict';
import asyncEvery from './every';
import asyncEveryStrict from './every_strict';
import asyncMap from './map';
import asyncMapStrict from './map_strict';
import asyncReduce from './reduce';
import asyncSome from './some';
import asyncSomeStrict from './some_strict';
import asyncFilter from './filter.js';
import asyncFilterStrict from './filter_strict.js';
import asyncFind from './find.js';
import asyncFindIndex from './findIndex.js';
import asyncForEach from './forEach.js';
import asyncForEachStrict from './forEach_strict.js';
import asyncEvery from './every.js';
import asyncEveryStrict from './every_strict.js';
import asyncMap from './map.js';
import asyncMapStrict from './map_strict.js';
import asyncReduce from './reduce.js';
import asyncSome from './some.js';
import asyncSomeStrict from './some_strict.js';

export {
asyncFilter,
Expand Down
4 changes: 2 additions & 2 deletions src/map.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import asyncMap from './map';
import asyncMap from './map.js';

import {
doubleInputArr,
Expand All @@ -9,7 +9,7 @@ import {
inputArr,
makeDelayed,
throws,
} from '../test-utils';
} from '../test-utils.js';

describe('asyncMap()', () => {
it('example from README works as described', async () => {
Expand Down
4 changes: 2 additions & 2 deletions src/map_strict.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import asyncMapStrict from './map_strict';
import asyncMapStrict from './map_strict.js';

import {
doubleInputArr,
Expand All @@ -11,7 +11,7 @@ import {
makePushDuplicate,
makePushDuplicateInRandomTime,
throws,
} from '../test-utils';
} from '../test-utils.js';

describe('asyncMapStrict()', () => {
it('example from README works as described', async () => {
Expand Down
4 changes: 2 additions & 2 deletions src/reduce.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it, vi } from 'vitest';
import asyncReduce from './reduce';
import asyncReduce from './reduce.js';

import { getTimer, makeDelayed, throws } from '../test-utils';
import { getTimer, makeDelayed, throws } from '../test-utils.js';

describe('asyncReduce()', () => {
it('example from README works as described', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/reduce.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import asyncForEachStrict from './forEach_strict';
import asyncForEachStrict from './forEach_strict.js';

function asyncReduce<T>(
arr: T[],
Expand Down
4 changes: 2 additions & 2 deletions src/some.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import asyncSome from './some';
import asyncSome from './some.js';

import {
inputArr,
Expand All @@ -10,7 +10,7 @@ import {
getTimer,
makeDelayed,
throws,
} from '../test-utils';
} from '../test-utils.js';

const firstElementLargerThanTwo = inputArr.findIndex(largerThanTwo);

Expand Down
2 changes: 1 addition & 1 deletion src/some.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import asyncForEach from './forEach';
import asyncForEach from './forEach.js';

function asyncSome<T>(
arr: T[],
Expand Down
4 changes: 2 additions & 2 deletions src/some_strict.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import asyncSomeStrict from './some_strict';
import asyncSomeStrict from './some_strict.js';

import {
doubleInputArr,
Expand All @@ -13,7 +13,7 @@ import {
makeDelayed,
getTimer,
throws,
} from '../test-utils';
} from '../test-utils.js';

const firstElementLargerThanTwo = inputArr.findIndex(largerThanTwo);

Expand Down
2 changes: 1 addition & 1 deletion src/some_strict.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import asyncForEachStrict from './forEach_strict';
import asyncForEachStrict from './forEach_strict.js';

function asyncSomeStrict<T>(
arr: T[],
Expand Down