Skip to content

feat(array): add arrFlatMap with ES5 polyfill#533

Merged
nev21 merged 1 commit intomainfrom
nev21/array
Mar 29, 2026
Merged

feat(array): add arrFlatMap with ES5 polyfill#533
nev21 merged 1 commit intomainfrom
nev21/array

Conversation

@nev21
Copy link
Copy Markdown
Contributor

@nev21 nev21 commented Mar 26, 2026

  • Add arrFlatMap and polyArrFlatMap implementations with one-level flatten behavior for mapped values.
  • Introduce ArrFlatMapCallbackFn type for array and array-like callback signatures.
  • Export arrFlatMap and the callback type from public index and polyfills entry points.

@nev21 nev21 added this to the 0.14.0 milestone Mar 26, 2026
@nev21 nev21 requested a review from a team as a code owner March 26, 2026 04:59
Copilot AI review requested due to automatic review settings March 26, 2026 04:59
@nev21 nev21 requested a review from a team as a code owner March 26, 2026 04:59
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.44%. Comparing base (53d481f) to head (9094157).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #533      +/-   ##
==========================================
+ Coverage   98.86%   99.44%   +0.58%     
==========================================
  Files         140      141       +1     
  Lines        4147     4181      +34     
  Branches      892      922      +30     
==========================================
+ Hits         4100     4158      +58     
+ Misses         47       23      -24     
Files with missing lines Coverage Δ
lib/src/array/callbacks.ts 100.00% <ø> (+50.00%) ⬆️
lib/src/array/flatMap.ts 100.00% <100.00%> (ø)
lib/src/array/flatten.ts 100.00% <ø> (ø)
lib/src/polyfills.ts 94.11% <100.00%> (+41.05%) ⬆️

... and 3 files with indirect coverage changes

🚀 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds arrFlatMap (with polyArrFlatMap) to @nevware21/ts-utils, extending the Array helper surface with an ES5-compatible flatMap implementation and public exports.

Changes:

  • Added arrFlatMap helper and polyArrFlatMap polyfill implementation.
  • Introduced ArrFlatMapCallbackFn type and exported it from the main index.
  • Added common tests, updated polyfills entry/export wiring, and adjusted bundle size thresholds/docs.

Reviewed changes

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

Show a summary per file
File Description
lib/src/array/flatMap.ts New arrFlatMap wrapper + polyArrFlatMap implementation.
lib/src/array/callbacks.ts Adds ArrFlatMapCallbackFn type for flatMap callbacks.
lib/src/index.ts Exports arrFlatMap and ArrFlatMapCallbackFn publicly.
lib/src/polyfills.ts Registers flatMap in prototype polyfill installation and exports polyArrFlatMap.
lib/src/array/flatten.ts Updates docs to reference arrFlatMap for map-then-flatten workflows.
lib/test/src/common/array/flatMap.test.ts Adds coverage for arrFlatMap, polyArrFlatMap, and export wiring.
lib/test/bundle-size-check.js Increases bundle size thresholds for ES5 minified artifacts.
.size-limit.json Updates size-limit thresholds for built ES5/ES6 modules.
docs/feature-backlog.md Updates backlog entry related to arrFlatMap (currently with a content issue).

nevware21-bot
nevware21-bot previously approved these changes Mar 26, 2026
Copy link
Copy Markdown
Contributor

@nevware21-bot nevware21-bot left a comment

Choose a reason for hiding this comment

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

Approved by nevware21-bot

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 9 out of 9 changed files in this pull request and generated 3 comments.

nevware21-bot
nevware21-bot previously approved these changes Mar 26, 2026
Copy link
Copy Markdown
Contributor

@nevware21-bot nevware21-bot left a comment

Choose a reason for hiding this comment

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

Approved by nevware21-bot

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 9 out of 9 changed files in this pull request and generated 4 comments.

- Add `arrFlatMap` and `polyArrFlatMap` implementations with one-level flatten behavior for mapped values.
- Introduce `ArrFlatMapCallbackFn` type for array and array-like callback signatures.
- Export `arrFlatMap` and the callback type from public index and polyfills entry points.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 9 out of 9 changed files in this pull request and generated no new comments.

@nev21 nev21 enabled auto-merge (squash) March 29, 2026 20:38
Copy link
Copy Markdown
Contributor

@nevware21-bot nevware21-bot left a comment

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 df4afdc into main Mar 29, 2026
14 checks passed
@nev21 nev21 deleted the nev21/array branch March 29, 2026 21:30
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