feat: add 30 new helpers across number, type, array, string, object, date, node, observable#92
Conversation
- 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>
- 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>
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
number/,type/,node/,observable/— iteration protocol (isGenerator,isAsyncGenerator,isAsyncIterable, …), general purpose (isPropertyKey,isPromiseLike,isArrayLike), Node.js (isNodeStream,isSharedArrayBuffer),isObservableisEmpty/isNonEmpty/isBlank/isNotBlankper category (array/,string/,object/) — replaces monolithictype/isEmpty(now@deprecated)array/select— filter + map in a single pass (Radashi-style); index passed to mapper is the original array index, documented explicitlytype/— removed state predicates:isNonEmptyArray,isNonEmptyStringdeleted;isNegativeNumber→number/isNegative,isPositiveNumber→number/isPositive;isValidDate→date/isValidAGENTS.md— new "Helper Placement" rule: type predicates →type/, state predicates → their own categorydocs/native-alternatives.json— addedisInfiniteand other helpers that map directly to native JSTest plan
npx vitest run --coverage→ 389 files, 3785 tests, 100% coverage (statements / branches / functions / lines)npx tsc --noEmit→ 0 errorsselect()index semantics documented and tested (original index, not post-filter)type/isTimestamp.ts@seereference updated todate/isValidisNegative(-Infinity)andisPositive(Infinity)documented in JSDoc examples🤖 Generated with Claude Code