Skip to content

fix: add rest.length > 0 guard to deepStrictAssert#41

Merged
kakasoo merged 1 commit intomainfrom
kakasoo/fix-deep-strict-unbrand
Feb 20, 2026
Merged

fix: add rest.length > 0 guard to deepStrictAssert#41
kakasoo merged 1 commit intomainfrom
kakasoo/fix-deep-strict-unbrand

Conversation

@kakasoo
Copy link
Owner

@kakasoo kakasoo commented Feb 20, 2026

Summary

  • Add missing rest.length > 0 guard to deepStrictAssert to prevent runtime error when picking top-level keys whose values are plain objects
  • Matches the fix already present in deepStrictPick
  • Add test case for top-level object property access

Test plan

  • All 380 existing tests pass
  • New test test_functions_deepStrictAssert_accesses_top_level_object_property verifies the fix

🤖 Generated with Claude Code

… error on top-level object properties

Matches the fix already present in deepStrictPick. When picking a top-level key whose value is a plain object, the missing guard caused traverse() to be called with an empty keys array, resulting in undefined being used as a key.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kakasoo kakasoo merged commit 6542137 into main Feb 20, 2026
1 check passed
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