Skip to content

feat(iterator): add iterator collection helpers with docs and tests#574

Merged
nev21 merged 1 commit into
mainfrom
nev21/iterFuncs
May 29, 2026
Merged

feat(iterator): add iterator collection helpers with docs and tests#574
nev21 merged 1 commit into
mainfrom
nev21/iterFuncs

Conversation

@nev21

@nev21 nev21 commented May 29, 2026

Copy link
Copy Markdown
Contributor
  • add new iterator helper module with typed exports:
    • iterMap, iterFilter, iterTake, iterReduce, iterSome, iterEvery, iterToArray
    • arrToMap, iterUnion, iterIntersection, iterDifference
    • IterMapCallbackFn, IterPredicateCallbackFn, IterReduceCallbackFn, ArrToMapKeySelectorFn, ArrToMapValueSelectorFn
  • export new iterator helpers from index.ts
  • add comprehensive common tests for helper behavior and edge cases in helpers.test.ts
  • add TypeDoc examples and mark new APIs as @SInCE 0.15.0 in helpers.ts
  • update Iterator utility matrix in README.md to include all new helper links

@nev21 nev21 added this to the 0.15.0 milestone May 29, 2026
Copilot AI review requested due to automatic review settings May 29, 2026 05:03
@nev21 nev21 requested review from a team as code owners May 29, 2026 05:03
@codecov

codecov Bot commented May 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.53846% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.24%. Comparing base (87cb303) to head (e984073).

Files with missing lines Patch % Lines
lib/src/iterator/helpers.ts 90.00% 4 Missing ⚠️
lib/src/array/arrToMap.ts 90.90% 3 Missing ⚠️
lib/src/iterator/iterTake.ts 97.67% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #574      +/-   ##
==========================================
- Coverage   99.35%   99.24%   -0.11%     
==========================================
  Files         165      178      +13     
  Lines        5089     5417     +328     
  Branches     1116     1186      +70     
==========================================
+ Hits         5056     5376     +320     
- Misses         33       41       +8     
Files with missing lines Coverage Δ
lib/src/funcs/fnBindArgs.ts 100.00% <ø> (ø)
lib/src/funcs/funcs.ts 100.00% <ø> (ø)
lib/src/iterator/forOf.ts 100.00% <100.00%> (ø)
lib/src/iterator/iterDifference.ts 100.00% <100.00%> (ø)
lib/src/iterator/iterEvery.ts 100.00% <100.00%> (ø)
lib/src/iterator/iterFilter.ts 100.00% <100.00%> (ø)
lib/src/iterator/iterIntersection.ts 100.00% <100.00%> (ø)
lib/src/iterator/iterMap.ts 100.00% <100.00%> (ø)
lib/src/iterator/iterReduce.ts 100.00% <100.00%> (ø)
lib/src/iterator/iterSome.ts 100.00% <100.00%> (ø)
... and 6 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds iterator and collection helper APIs to @nevware21/ts-utils, along with exports, documentation, tests, and updated size thresholds.

Changes:

  • Added iterator helpers for mapping, filtering, taking, reducing, predicates, materialization, and set-like operations.
  • Added arrToMap and related public callback types.
  • Added common tests, README utility links, backlog cleanup, and adjusted bundle size limits.

Reviewed changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
README.md Adds new iterator helper links to the utility matrix.
.size-limit.json Raises size-limit thresholds for expanded bundle output.
docs/feature-backlog.md Removes implemented iterator helper backlog items.
lib/test/bundle-size-check.js Raises bundle size check thresholds.
lib/src/index.ts Exports new array and iterator helper APIs.
lib/src/array/arrToMap.ts Adds object-map creation helper.
lib/src/iterator/types.ts Adds callback type aliases for new helpers.
lib/src/iterator/helpers.ts Adds internal iterator normalization helpers.
lib/src/iterator/iterMap.ts Adds lazy iterator map helper.
lib/src/iterator/iterFilter.ts Adds lazy iterator filter helper.
lib/src/iterator/iterTake.ts Adds lazy iterator take helper.
lib/src/iterator/iterReduce.ts Adds iterator reduce helper.
lib/src/iterator/iterSome.ts Adds iterator some helper.
lib/src/iterator/iterEvery.ts Adds iterator every helper.
lib/src/iterator/iterToArray.ts Adds iterator materialization helper.
lib/src/iterator/iterUnion.ts Adds iterator union helper.
lib/src/iterator/iterIntersection.ts Adds iterator intersection helper.
lib/src/iterator/iterDifference.ts Adds iterator difference helper.
lib/test/src/common/array/arrToMap.test.ts Adds tests for arrToMap.
lib/test/src/common/iterator/iterMap.test.ts Adds tests for iterMap.
lib/test/src/common/iterator/iterFilter.test.ts Adds tests for iterFilter.
lib/test/src/common/iterator/iterTake.test.ts Adds tests for iterTake.
lib/test/src/common/iterator/iterReduce.test.ts Adds tests for iterReduce.
lib/test/src/common/iterator/iterSome.test.ts Adds tests for iterSome.
lib/test/src/common/iterator/iterEvery.test.ts Adds tests for iterEvery.
lib/test/src/common/iterator/iterToArray.test.ts Adds tests for iterToArray.
lib/test/src/common/iterator/iterUnion.test.ts Adds tests for iterUnion.
lib/test/src/common/iterator/iterIntersection.test.ts Adds tests for iterIntersection.
lib/test/src/common/iterator/iterDifference.test.ts Adds tests for iterDifference.

Comment thread lib/src/iterator/iterUnion.ts Outdated
Comment thread lib/src/iterator/iterIntersection.ts Outdated
Comment thread lib/src/iterator/iterDifference.ts Outdated
Comment thread lib/src/iterator/iterIntersection.ts Outdated
Comment thread lib/src/array/arrToMap.ts Outdated
nevware21-bot
nevware21-bot previously approved these changes May 29, 2026

@nevware21-bot nevware21-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by nevware21-bot

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 29 out of 29 changed files in this pull request and generated 2 comments.

Comment thread lib/src/iterator/helpers.ts Outdated
Comment thread lib/src/iterator/helpers.ts
nevware21-bot
nevware21-bot previously approved these changes May 29, 2026

@nevware21-bot nevware21-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by nevware21-bot

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 30 out of 30 changed files in this pull request and generated 1 comment.

Comment thread lib/src/iterator/iterTake.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 33 out of 33 changed files in this pull request and generated 3 comments.

Comment thread lib/src/iterator/iterToArray.ts Outdated
Comment thread lib/src/iterator/iterMap.ts
Comment thread lib/src/iterator/iterFilter.ts
nevware21-bot
nevware21-bot previously approved these changes May 29, 2026

@nevware21-bot nevware21-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by nevware21-bot

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 33 out of 33 changed files in this pull request and generated 3 comments.

Comment thread lib/src/iterator/iterTake.ts Outdated
Comment thread lib/src/iterator/types.ts Outdated
Comment thread lib/src/iterator/types.ts Outdated
nevware21-bot
nevware21-bot previously approved these changes May 29, 2026

@nevware21-bot nevware21-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by nevware21-bot

- add new iterator helper module with typed exports:
  - iterMap, iterFilter, iterTake, iterReduce, iterSome, iterEvery, iterToArray
  - arrToMap, iterUnion, iterIntersection, iterDifference
  - IterMapCallbackFn, IterPredicateCallbackFn, IterReduceCallbackFn, ArrToMapKeySelectorFn, ArrToMapValueSelectorFn
- export new iterator helpers from index.ts
- add comprehensive common tests for helper behavior and edge cases in helpers.test.ts
- add TypeDoc examples and mark new APIs as @SInCE 0.15.0 in helpers.ts
- update Iterator utility matrix in README.md to include all new helper links

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 33 out of 33 changed files in this pull request and generated no new comments.

@nevware21-bot nevware21-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by nevware21-bot

@nev21 nev21 merged commit 382853e into main May 29, 2026
11 checks passed
@nev21 nev21 deleted the nev21/iterFuncs branch May 29, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants