Skip to content

feat: add 30 new helpers across number, type, array, string, object, date, node, observable#92

Merged
baxyz merged 34 commits into
mainfrom
for_2-0-3
Jun 16, 2026
Merged

feat: add 30 new helpers across number, type, array, string, object, date, node, observable#92
baxyz merged 34 commits into
mainfrom
for_2-0-3

Conversation

@baxyz

@baxyz baxyz commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • 19 new type/state predicates across number/, type/, node/, observable/ — iteration protocol (isGenerator, isAsyncGenerator, isAsyncIterable, …), general purpose (isPropertyKey, isPromiseLike, isArrayLike), Node.js (isNodeStream, isSharedArrayBuffer), isObservable
  • isEmpty / isNonEmpty / isBlank / isNotBlank per category (array/, string/, object/) — replaces monolithic type/isEmpty (now @deprecated)
  • array/select — filter + map in a single pass (Radashi-style); index passed to mapper is the original array index, documented explicitly
  • Reorganised type/ — removed state predicates: isNonEmptyArray, isNonEmptyString deleted; isNegativeNumbernumber/isNegative, isPositiveNumbernumber/isPositive; isValidDatedate/isValid
  • AGENTS.md — new "Helper Placement" rule: type predicates → type/, state predicates → their own category
  • docs/native-alternatives.json — added isInfinite and other helpers that map directly to native JS

Test plan

  • npx vitest run --coverage → 389 files, 3785 tests, 100% coverage (statements / branches / functions / lines)
  • npx tsc --noEmit → 0 errors
  • Verified: select() index semantics documented and tested (original index, not post-filter)
  • Verified: type/isTimestamp.ts @see reference updated to date/isValid
  • Verified: isNegative(-Infinity) and isPositive(Infinity) documented in JSDoc examples

🤖 Generated with Claude Code

baxyz added 2 commits June 15, 2026 19:54
- change @SInCE tag to @internal
refactor(sortNatural): ♻️ move natVal function to internal
- add double-safety check for @SInCE tag in processMember
baxyz and others added 26 commits June 16, 2026 20:50
- define runtimes for node and browser in package.json
- update createBundleMetadata to read from runtimes field
- enhance type extraction logic in buildWebsiteMetadata
- implement isNodeStream to check for Node.js streams
- add property-based tests for isNodeStream
- create example usage for isNodeStream
- implement isSharedArrayBuffer to check for SharedArrayBuffer instances
- add examples for usage and testing
- implement isEven function to check for even integers
- add examples for usage of isEven
- create property-based and contract tests for isEven
- implement isOdd function to check for odd integers
- add examples for usage of isOdd
- create property-based and contract tests for isOdd
- implement isObservable to check RxJS observables
- add examples for usage in isObservable.example.ts
- create tests for isObservable in isObservable.spec.ts and isObservable.test.ts
- implement isArrayLike to check array-like values
- add examples for usage and assertions
- create property-based and contract tests for isArrayLike
- implement isAsyncGenerator to check async generator instances
- add examples for usage and assertions
- create tests for isAsyncGenerator functionality
- implement isAsyncGeneratorFunction to check async generator functions
- add examples for usage in isAsyncGeneratorFunction.example.ts
- create tests for isAsyncGeneratorFunction in isAsyncGeneratorFunction.spec.ts
- add additional tests in isAsyncGeneratorFunction.test.ts
- implement isAsyncIterable to check async iterable protocol
- add examples for async generators and custom async iterables
- create tests for various cases including primitives and null
- implement isGenerator function to check for generator instances
- add examples demonstrating usage of isGenerator
- create property-based and contract tests for isGenerator
- implement isGeneratorFunction to check for generator functions
- add examples for detecting generator functions
- create property-based and contract tests for isGeneratorFunction
- implement isPromiseLike to check for thenable objects
- add examples for usage of isPromiseLike
- create tests for isPromiseLike functionality
- implement isPropertyKey to validate property keys
- add examples for valid and invalid property keys
- create property-based tests for isPropertyKey
- add contract tests for isPropertyKey
- clarify current state and decision for isEmpty
- outline planned helpers for array, string, and object
- address open questions regarding implementation
…ples

- implement isEmpty for arrays
- implement isNonEmpty for arrays
- add tests for both helpers
- add examples for usage
feat(object): ✨ add isEmpty and isNonEmpty helpers with tests and examples
- implement isEmpty for objects
- implement isNonEmpty for objects
- add tests for both helpers
- add examples for usage
feat(string): ✨ add isEmpty and isNonEmpty helpers with tests and examples
- implement isEmpty for strings
- implement isNonEmpty for strings
- add tests for both helpers
- add examples for usage
refactor(type): ♻️ deprecate monolithic isEmpty helper
- suggest category-specific helpers instead
- implement isBlank to check for empty or whitespace-only strings
- add property-based tests for isBlank
- create unit tests for isBlank functionality
- implement isNotBlank to check for non-blank strings
- add examples for usage
- create property-based and contract tests
- implement select function for filtering and transforming arrays
- add examples for usage in select.example.ts
- create property-based tests in select.spec.ts
- add unit tests in select.test.ts
- implement isValid function to check Date instances
- add property-based and contract tests for isValid
- remove outdated isValidDate tests and specs
- implement isNegative function to check for negative numbers
- add property-based and contract tests for isNegative
- remove isNegativeNumber tests and implementation
- clarify select() index semantics in JSDoc and spec (original index, not post-filter)
- add explicit test for select() original-index behavior
- fix dangling @see {@link isValidDate} in isTimestamp.ts → date/isValid
- document Infinity/-Infinity in isPositive/isNegative examples

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
baxyz and others added 5 commits June 16, 2026 20:50
- add eslint-disable unicorn/no-thenable comments in isPromiseLike tests and example
- remove top-level node:stream import from isNodeStream.example.ts to fix
  build-website-metadata license lookup (node:stream is a built-in, not a package)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- add @babel/core to package.json and pnpm-lock.yaml
- update babel dependencies to version 7.29.7
- implement extractNumber function to extract numbers from strings
- add benchmarks for performance testing
- create property-based tests for various scenarios
- include unit tests for edge cases and sign handling
…ncies

- implement caching for source file contents
- add function to strip comments from source text
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@baxyz baxyz merged commit 8b49901 into main Jun 16, 2026
15 checks passed
@baxyz baxyz deleted the for_2-0-3 branch June 16, 2026 21:04
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.

1 participant