Skip to content

feat: add isAsyncIterable and isIntegerInRange type/value inspection helpers#536

Merged
nev21 merged 1 commit intomainfrom
nev21/typing
Mar 30, 2026
Merged

feat: add isAsyncIterable and isIntegerInRange type/value inspection helpers#536
nev21 merged 1 commit intomainfrom
nev21/typing

Conversation

@nev21
Copy link
Copy Markdown
Contributor

@nev21 nev21 commented Mar 30, 2026

  • isAsyncIterable(value): checks for Symbol.asyncIterator presence using the existing well-known symbol abstraction; safe in ES5 environments where the symbol is absent (returns false). Located in iterator/iterator.ts.
  • isIntegerInRange(value, min, max): validates that value, min, and max are all integers and that min <= value <= max. Built on existing isInteger helper. Located in helpers/number.ts.

…helpers

- isAsyncIterable<T>(value): checks for Symbol.asyncIterator presence using
  the existing well-known symbol abstraction; safe in ES5 environments where
  the symbol is absent (returns false). Located in iterator/iterator.ts.
- isIntegerInRange(value, min, max): validates that value, min, and max are
  all integers and that min <= value <= max. Built on existing isInteger
  helper. Located in helpers/number.ts.
@nev21 nev21 added this to the 0.14.0 milestone Mar 30, 2026
@nev21 nev21 requested review from a team as code owners March 30, 2026 05:45
Copilot AI review requested due to automatic review settings March 30, 2026 05:45
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #536   +/-   ##
=======================================
  Coverage   99.45%   99.45%           
=======================================
  Files         142      142           
  Lines        4187     4196    +9     
  Branches      922      926    +4     
=======================================
+ Hits         4164     4173    +9     
  Misses         23       23           
Files with missing lines Coverage Δ
lib/src/helpers/number.ts 96.96% <100.00%> (+0.41%) ⬆️
lib/src/iterator/iterator.ts 100.00% <100.00%> (ø)
🚀 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

This PR adds two new inspection helpers to @nevware21/ts-utils—one for identifying async iterables and one for validating integers within an inclusive range—along with accompanying tests and documentation updates.

Changes:

  • Add isAsyncIterable() to iterator helpers and export it from the package entrypoint.
  • Add isIntegerInRange() to number helpers, export it, and add common tests.
  • Update docs/backlog and bump dev tool versions (api-extractor, typedoc); add ESNext iterator tests for async iterables.

Reviewed changes

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

Show a summary per file
File Description
package.json Bumps devDependencies for api-extractor and typedoc.
lib/src/iterator/iterator.ts Adds isAsyncIterable() type/value inspection helper.
lib/src/helpers/number.ts Adds isIntegerInRange() helper built on isInteger().
lib/src/index.ts Exports the new helpers from the root entrypoint; also changes string exports.
lib/test/src/esnext/iterator/iterator.test.ts Adds ESNext tests covering isAsyncIterable() behavior.
lib/test/src/common/helpers/number.test.ts Adds common tests covering isIntegerInRange() behavior and edge cases.
docs/feature-backlog.md Removes backlog entries that are now implemented and adjusts section heading.
docs/README.md Updates docs README feature list to mention the new helpers.
README.md Updates the function index to include links for isAsyncIterable() and isIntegerInRange().

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 f8e0445 into main Mar 30, 2026
14 checks passed
@nev21 nev21 deleted the nev21/typing branch March 30, 2026 15:33
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