Repository navigation
feat(fjl): add charRange generator - #147
Merged
Merged
Conversation
Reuses numRange, so it has the same inclusive range and step semantics, stepping by code point. Throws when start or end isn't a single character. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Adds the missing half of #89:
charRange, a generator insrc/string/charRange.ts, plus a curried$charRange.numRangealready landed.It's built on
numRange, so the range is inclusive andstepis normalized the same way. It steps by code point, so characters outside the BMP work. Passing anything other than a single character throws. Without that check, an empty string would makecodePointAtreturnundefined, andnumRangewould silently use its default range.Closes #89
Testing
tests/string/test-charRange.ts, and a$charRangeentry in thetests/test-currying.tsregistrypnpm test: 134 suites and 1478 tests passnpx tsc --noEmit -p packages/fjl/tsconfig.json: cleanpnpm build: succeeds, andcharRangeworks fromdist/cjs/index.cjseslinton changed files: clean🤖 Generated with Claude Code