Skip to content

Conversation

@aprendendofelipe
Copy link
Owner

No description provided.

@vercel
Copy link

vercel bot commented Jan 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
react-form Ready Ready Preview, Comment Jan 5, 2026 4:51pm
react-markdown Ready Ready Preview, Comment Jan 5, 2026 4:51pm

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 5, 2026

Open in StackBlitz

@barso/forms

npm i https://pkg.pr.new/@barso/forms@90

@barso/helpers

npm i https://pkg.pr.new/@barso/helpers@90

@barso/hooks

npm i https://pkg.pr.new/@barso/hooks@90

@barso/infra

npm i https://pkg.pr.new/@barso/infra@90

@barso/ui

npm i https://pkg.pr.new/@barso/ui@90

commit: 12c5bf3

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 modifies the deepMerge function to only deeply merge plain objects (object literals), while treating built-in objects like Date, Map, Set, and RegExp as atomic values that should be replaced rather than merged.

Key changes:

  • Introduced a new isPlainObject helper function that distinguishes plain objects from built-in objects and class instances
  • Updated deepMerge to use isPlainObject instead of isObject for merge decisions
  • Added comprehensive test coverage for the new behavior with various built-in object types

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/helpers/src/is.js Added new isPlainObject function to check if a value is a plain object literal
packages/helpers/src/is.test.js Added comprehensive tests for isPlainObject covering primitives, arrays, built-in objects, and custom prototypes
packages/helpers/src/merge.js Updated deepMerge to use isPlainObject instead of isObject to prevent merging built-in objects
packages/helpers/src/merge.test.js Added tests verifying that RegExp, Map, Set, and Date objects are replaced rather than merged
Comments suppressed due to low confidence (1)

packages/helpers/src/merge.js:7

  • The function documentation should be updated to clarify that it only deeply merges plain objects (object literals). Built-in objects like Date, Map, Set, and RegExp are replaced rather than merged. Consider updating the JSDoc to explain this behavior, for example: "Deeply merges two plain objects. Built-in objects (Date, Map, Set, RegExp, etc.) are replaced by the source value rather than merged."
/**
 * Deeply merges two objects.
 * @param {*} target - The target object to merge into.
 * @param {*} source - The source object to merge from.
 * @returns {*} - The merged object.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants