feat: add isAsyncIterable and isIntegerInRange type/value inspection helpers#536
Merged
feat: add isAsyncIterable and isIntegerInRange type/value inspection helpers#536
Conversation
Contributor
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.
Codecov Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
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(). |
nevware21-bot
approved these changes
Mar 30, 2026
Contributor
nevware21-bot
left a comment
There was a problem hiding this comment.
Approved by nevware21-bot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.