Skip to content

Conversation

@webdeveric
Copy link
Owner

  • Added has(), set(), and assertPathExists()
  • Added more utility types

@webdeveric webdeveric requested a review from Copilot July 19, 2025 19:00

This comment was marked as outdated.

@webdeveric webdeveric requested a review from Copilot July 19, 2025 20:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds three new utility functions (has(), set(), and assertPathExists()) for working with object paths, along with supporting utility types for type-safe path manipulation. The changes enable checking for path existence, setting values at specific paths, and asserting path existence with optional type validation.

Key Changes

  • New path manipulation functions: Added has() for checking path existence, set() for setting values at paths, and assertPathExists() for path existence assertions
  • Enhanced type system: Added utility types like FromPath, WithPath, Merge, and ParseNumber to support type-safe path operations
  • Comprehensive test coverage: Added extensive unit tests and type tests for all new functionality

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/has.ts Implements has() function with type predicates for path existence checking
src/set.ts Implements set() function for setting values at object paths with prototype pollution protection
src/assertion/assertPathExists.ts Implements assertion function for path existence with optional type validation
src/types/objects.ts Adds utility types FromPath, WithPath, Merge for advanced object path manipulation
src/types/utils.ts Adds ParseNumber utility type for string-to-number parsing
src/get.ts Updates parameter type from string to PropertyKey for consistency
test/ files Comprehensive test coverage for all new functionality

@webdeveric webdeveric merged commit 697f516 into master Jul 20, 2025
4 checks passed
@webdeveric webdeveric deleted the dev branch July 20, 2025 03:25
@github-actions
Copy link

🎉 This PR is included in version 0.69.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants