Skip to content

fix(utils): improve isArrayLike robustness and type safety#7573

Open
mrsants wants to merge 3 commits intoReactiveX:masterfrom
mrsants:fix/isarraylike-validation
Open

fix(utils): improve isArrayLike robustness and type safety#7573
mrsants wants to merge 3 commits intoReactiveX:masterfrom
mrsants:fix/isarraylike-validation

Conversation

@mrsants
Copy link

@mrsants mrsants commented Oct 15, 2025

  • Added null and primitive guards to prevent invalid inputs
  • Excluded strings and functions from being treated as array-like
  • Ensured length is finite and non-negative using defensive checks
  • Replaced direct property access with safer Reflect operations
  • Improved TypeScript type narrowing for stronger type safety

Description:

BREAKING CHANGE: N/A

Related issue (if exists): N/A

- Added null and primitive guards to prevent invalid inputs
- Excluded strings and functions from being treated as array-like
- Ensured length is finite and non-negative using defensive checks
- Replaced direct property access with safer Reflect operations
- Improved TypeScript type narrowing for stronger type safety
@mrsants mrsants closed this Oct 15, 2025
@mrsants mrsants reopened this Oct 15, 2025
- Added null, primitive, and string guards to prevent invalid inputs
- Ensured `length` is finite and non-negative using Reflect-based property access
- Excluded functions and strings from being treated as array-like
- Improved type narrowing for safer inference in Observable input detection
- Added comprehensive unit tests covering edge cases (null, string, function, negative length, valid array-like)
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