Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor behaviour difference in cloneDeepWith compared to lodash-es #953

Open
filipsobol opened this issue Feb 3, 2025 · 0 comments
Open

Comments

@filipsobol
Copy link
Contributor

filipsobol commented Feb 3, 2025

Given the following code:

const data = cloneDeepWith( Object.create( null ) );
console.log( data.toString );

The object returned by lodash-es has an Object prototype, even though the original object was created using Object.create( null ), so the output to the console is [Function: toString]. However, the same function in es-toolkit/compat returns an object without a prototype, so the output to the console is undefined.

While the es-toolkit behavior makes more sense to me, you may consider this a bug if you care about full backward compatibility with lodash.


Reproduction: https://stackblitz.com/edit/node-e1e3y8ws?file=index.js

In the console, run node index.js.

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

No branches or pull requests

1 participant