iterable-linq-utility 0.0.16 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +72 -0
  2. package/dist/index.d.cts +875 -0
  3. package/dist/index.d.ts +875 -14
  4. package/dist/iterable-linq-utility.js +641 -0
  5. package/dist/iterable-linq-utility.umd.cjs +1 -0
  6. package/package.json +42 -24
  7. package/dist/collections/index.d.ts +0 -2
  8. package/dist/collections/linkedList.d.ts +0 -24
  9. package/dist/functions/collectToArray.d.ts +0 -1
  10. package/dist/functions/empty.d.ts +0 -1
  11. package/dist/functions/filter.d.ts +0 -9
  12. package/dist/functions/flatMap.d.ts +0 -8
  13. package/dist/functions/forEach.d.ts +0 -3
  14. package/dist/functions/index.d.ts +0 -23
  15. package/dist/functions/map.d.ts +0 -9
  16. package/dist/functions/materialize.d.ts +0 -7
  17. package/dist/functions/max.d.ts +0 -9
  18. package/dist/functions/memoize.d.ts +0 -11
  19. package/dist/functions/min.d.ts +0 -9
  20. package/dist/functions/range.d.ts +0 -7
  21. package/dist/functions/reduce.d.ts +0 -10
  22. package/dist/functions/repeat.d.ts +0 -1
  23. package/dist/functions/some.d.ts +0 -9
  24. package/dist/functions/tap.d.ts +0 -9
  25. package/dist/functions/tapChain.d.ts +0 -9
  26. package/dist/interable-linq-utility.js +0 -708
  27. package/dist/interable-linq-utility.umd.cjs +0 -1
  28. package/dist/linqIterable.d.ts +0 -45
  29. package/dist/types/action.d.ts +0 -3
  30. package/dist/types/comparer.d.ts +0 -4
  31. package/dist/types/index.d.ts +0 -7
  32. package/dist/types/mapper.d.ts +0 -1
  33. package/dist/types/predicate.d.ts +0 -1
  34. package/dist/types/reducer.d.ts +0 -1
  35. package/dist/types/tapper.d.ts +0 -2
  36. package/dist/types/unit.d.ts +0 -3
  37. package/dist/utils/index.d.ts +0 -4
  38. package/dist/utils/iteratorResults.d.ts +0 -4
  39. package/dist/utils/utils.d.ts +0 -56
  40. package/dist/utils/validations.d.ts +0 -5
package/package.json CHANGED
@@ -1,26 +1,41 @@
1
1
  {
2
2
  "name": "iterable-linq-utility",
3
- "version": "0.0.16",
3
+ "version": "0.2.0",
4
4
  "description": "An Iterable mutation utility inspired by .net Linq and Javascript Array interface",
5
5
  "type": "module",
6
- "main": "./dist/interable-linq-utility.umd.cjs",
7
- "module": "./dist/interable-linq-utility.js",
6
+ "main": "./dist/iterable-linq-utility.umd.cjs",
7
+ "module": "./dist/iterable-linq-utility.js",
8
8
  "types": "./dist/index.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
- "import": "./dist/interable-linq-utility.js",
12
- "require": "./dist/interable-linq-utility.umd.cjs"
11
+ "import": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/iterable-linq-utility.js"
14
+ },
15
+ "require": {
16
+ "types": "./dist/index.d.cts",
17
+ "default": "./dist/iterable-linq-utility.umd.cjs"
18
+ }
13
19
  }
14
20
  },
15
21
  "files": [
16
22
  "dist"
17
23
  ],
18
24
  "scripts": {
19
- "build": "tsc -p tsconfig.build.json && vite build",
25
+ "build": "tsc -p tsconfig.build.json && vite build && cp dist/index.d.ts dist/index.d.cts",
26
+ "check:package": "attw --pack .",
27
+ "check:changeset": "changeset status --since=origin/main",
28
+ "check:since": "node scripts/check-since.ts",
29
+ "check:instructions": "node scripts/check-instructions.ts",
30
+ "check:structure": "node scripts/check-structure.ts",
20
31
  "dev": "vite",
21
- "lint": "eslint . --ext .js,.jsx,.ts,.tsx --ignore-path .eslintignore",
22
- "lint-fix": "eslint . --ext .js,.jsx,.ts,.tsx --fix --ignore-path .eslintignore",
32
+ "lint": "eslint .",
33
+ "lint-fix": "eslint . --fix",
34
+ "release:version": "changeset version && node scripts/set-since.ts",
35
+ "typecheck": "tsc -p tsconfig.test.json --noEmit",
23
36
  "test": "vitest run",
37
+ "bench": "vite build --logLevel error && vitest bench --run",
38
+ "bench:baseline": "vite build --logLevel error && BENCH_SAVE=1 vitest bench --run",
24
39
  "test:coverage": "vitest run --coverage",
25
40
  "test:ui": "vitest --ui"
26
41
  },
@@ -40,20 +55,23 @@
40
55
  "utility"
41
56
  ],
42
57
  "devDependencies": {
43
- "@rushstack/eslint-patch": "1.1.4",
44
- "@types/node": "18.11.10",
45
- "@typescript-eslint/eslint-plugin": "5.36.2",
46
- "@typescript-eslint/parser": "5.36.2",
47
- "@vitest/coverage-istanbul": "^0.26.2",
48
- "@vitest/ui": "0.25.2",
49
- "eslint": "8.22.0",
50
- "eslint-plugin-import": "2.26.0",
51
- "eslint-plugin-node": "11.1.0",
52
- "eslint-plugin-promise": "6.0.1",
53
- "typescript": "4.9.4",
54
- "vite": "4.0.4",
55
- "vite-plugin-dts": "1.7.1",
56
- "vite-tsconfig-paths": "4.0.5",
57
- "vitest": "0.28.3"
58
- }
58
+ "@arethetypeswrong/cli": "^0.18.5",
59
+ "@changesets/changelog-github": "^1.0.1",
60
+ "@changesets/cli": "^3.0.3",
61
+ "@eslint/js": "^10.0.1",
62
+ "@microsoft/api-extractor": "^7.59.2",
63
+ "@stylistic/eslint-plugin": "^5.10.0",
64
+ "@types/node": "^24.19.0",
65
+ "@vitest/coverage-istanbul": "^5.0.2",
66
+ "@vitest/ui": "^5.0.2",
67
+ "eslint": "^10.11.0",
68
+ "eslint-plugin-tsdoc": "^0.5.3",
69
+ "globals": "^17.12.0",
70
+ "typescript": "^6.0.3",
71
+ "typescript-eslint": "^8.70.1",
72
+ "vite": "^8.3.1",
73
+ "vite-plugin-dts": "^5.1.1",
74
+ "vitest": "^5.0.2"
75
+ },
76
+ "packageManager": "pnpm@11.24.0"
59
77
  }
@@ -1,2 +0,0 @@
1
- import * as LinkedListCollection from './linkedList';
2
- export { LinkedListCollection };
@@ -1,24 +0,0 @@
1
- export declare function from<T>(iterable: Iterable<T>): LinkedList<T>;
2
- export declare class LinkedList<T> implements Iterable<T> {
3
- private internalSize;
4
- private head;
5
- private tail;
6
- [Symbol.iterator](): LinkedListIterator<T>;
7
- private internalAddFirst;
8
- addFirst(value: T): this;
9
- private internalAddLast;
10
- addLast(value: T): this;
11
- size(): number;
12
- }
13
- export declare class LinkedListIterator<T> implements Iterator<T> {
14
- private current;
15
- constructor(current: IListNode<T> | null);
16
- private innerNext;
17
- next(): IteratorResult<T, any>;
18
- return(value?: any): IteratorResult<T, any>;
19
- }
20
- interface IListNode<T> {
21
- data: T;
22
- nextNode: IListNode<T> | null;
23
- }
24
- export {};
@@ -1 +0,0 @@
1
- export declare function collectToArray<T>(iterable: Iterable<T>): T[];
@@ -1 +0,0 @@
1
- export declare function empty<T>(): Iterable<T>;
@@ -1,9 +0,0 @@
1
- import { Predicate } from "../types";
2
- /**
3
- *
4
- * @operation `Transformation`
5
- * @param iterable
6
- * @param predicate
7
- * @returns
8
- */
9
- export declare function filter<T>(iterable: Iterable<T>, predicate: Predicate<T>): Iterable<T>;
@@ -1,8 +0,0 @@
1
- import { Mapper } from '../types';
2
- /**
3
- * @operation `Transformation`
4
- * @param iterable
5
- * @param mapper
6
- * @returns
7
- */
8
- export declare function flatMap<T, R>(iterable: Iterable<T>, mapper: Mapper<T, Iterable<R>>): Iterable<R>;
@@ -1,3 +0,0 @@
1
- import { Action, AsyncAction, Unit } from "../types";
2
- export declare function forEach<T>(iterable: Iterable<T>, action: Action<T>): Unit;
3
- export declare function forEachAsync<T>(iterable: Iterable<T>, action: AsyncAction<T>): Promise<Unit>;
@@ -1,23 +0,0 @@
1
- import { collectToArray } from './collectToArray';
2
- export { collectToArray };
3
- import { empty } from './empty';
4
- export { empty };
5
- import { filter } from './filter';
6
- import { flatMap } from './flatMap';
7
- import { forEach, forEachAsync } from './forEach';
8
- export { filter, flatMap, forEach, forEachAsync };
9
- import { map } from './map';
10
- import { materialize } from './materialize';
11
- import { max } from './max';
12
- import { memoize, getMemoizeDefaultOptions, IMemoizeOptions } from './memoize';
13
- import { min } from './min';
14
- export { map, materialize, max, memoize, getMemoizeDefaultOptions, type IMemoizeOptions, min };
15
- import { range } from './range';
16
- import { reduce } from './reduce';
17
- import { repeat } from './repeat';
18
- export { range, reduce, repeat };
19
- import { some } from './some';
20
- export { some };
21
- import { tap } from './tap';
22
- import { tapChain } from './tapChain';
23
- export { tap, tapChain };
@@ -1,9 +0,0 @@
1
- import { Mapper } from "../types";
2
- /**
3
- *
4
- * @operation `Transformation`
5
- * @param iterable
6
- * @param mapper
7
- * @returns
8
- */
9
- export declare function map<T, R>(iterable: Iterable<T>, mapper: Mapper<T, R>): Iterable<R>;
@@ -1,7 +0,0 @@
1
- /**
2
- *
3
- * @operation `Action`
4
- * @param iterable
5
- * @returns
6
- */
7
- export declare function materialize<T>(iterable: Iterable<T>): Iterable<T>;
@@ -1,9 +0,0 @@
1
- import type { Comparer } from "../types";
2
- /**
3
- *
4
- * @operation `Action`
5
- * @param iterable
6
- * @param comparer
7
- * @returns
8
- */
9
- export declare function max<T>(iterable: Iterable<T>, comparer?: Comparer<T>): T | null | undefined;
@@ -1,11 +0,0 @@
1
- export interface IMemoizeOptions {
2
- allowPartialMemoization?: boolean;
3
- }
4
- export declare function getMemoizeDefaultOptions(): IMemoizeOptions;
5
- /**
6
- *
7
- * @operation `Transformation`
8
- * @param iterable
9
- * @returns
10
- */
11
- export declare function memoize<T>(iterable: Iterable<T>, options?: IMemoizeOptions): Iterable<T>;
@@ -1,9 +0,0 @@
1
- import type { Comparer } from "../types";
2
- /**
3
- *
4
- * @operation `Action`
5
- * @param iterable
6
- * @param comparer
7
- * @returns
8
- */
9
- export declare function min<T>(iterable: Iterable<T>, comparer?: Comparer<T>): T | null | undefined;
@@ -1,7 +0,0 @@
1
- export declare function range(end: number): Iterable<number>;
2
- export declare function range(end: number, reverse?: boolean): Iterable<number>;
3
- export declare function range(start: number, end: number): Iterable<number>;
4
- export declare function range(start: number, end: number, step: number): Iterable<number>;
5
- export declare function range(start: number, end: number, reverse: boolean): Iterable<number>;
6
- export declare function range(start: number, end: number, step: number, reverse: boolean): Iterable<number>;
7
- export declare function range(start: number, end?: number | boolean, step?: number | boolean, reverse?: boolean): Iterable<number>;
@@ -1,10 +0,0 @@
1
- import { Reducer } from "../types";
2
- /**
3
- *
4
- * @operation `Action`
5
- * @param iterable
6
- * @param neutralElement
7
- * @param reducer
8
- * @returns
9
- */
10
- export declare function reduce<T, R>(iterable: Iterable<T>, neutralElement: R, reducer: Reducer<T, R>): R;
@@ -1 +0,0 @@
1
- export declare function repeat<T>(value: T, count: number): Iterable<T>;
@@ -1,9 +0,0 @@
1
- import { Predicate } from "../types";
2
- /**
3
- *
4
- * @operation `Action`
5
- * @param iterable
6
- * @param predicate
7
- * @returns
8
- */
9
- export declare function some<T>(iterable: Iterable<T>, predicate: Predicate<T>): boolean;
@@ -1,9 +0,0 @@
1
- import { Tapper } from "../types";
2
- /**
3
- *
4
- * @operation `Tap`
5
- * @param iterable
6
- * @param tapper
7
- * @returns
8
- */
9
- export declare function tap<T>(iterable: Iterable<T>, tapper: Tapper<T>): Iterable<T>;
@@ -1,9 +0,0 @@
1
- import { Tapper } from "../types";
2
- /**
3
- *
4
- * @operation `Tap`
5
- * @param iterable
6
- * @param tapper
7
- * @returns
8
- */
9
- export declare function tapChain<T>(iterable: Iterable<T>, tapper: Tapper<Iterable<T>>): Iterable<T>;