Skip to content

fix(cloneDeep): Copy all properties from the source using Reflect.ownKeys() #420

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

Closed
wants to merge 1 commit into from

Conversation

ShaoClean
Copy link

@ShaoClean ShaoClean commented Aug 23, 2024

const obj = {
    a: 1,
    b: 2,
    [Symbol('1')]: 1,
};
Object.defineProperty(obj, 'c', {
    value: 3,
    enumerable: false,
});

console.log(Object.keys(obj));
// ["a", "b"]
console.log(Reflect.ownKeys(obj));
// ["a", "b", "c", Symbol(1)]

@ShaoClean ShaoClean requested a review from raon0211 as a code owner August 23, 2024 07:57
Copy link

vercel bot commented Aug 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
es-toolkit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 23, 2024 7:59am

@raon0211 raon0211 changed the title fix: change get keys way fix(cloneDeep): Copy all properties from the source using Reflect.ownKeys() Aug 25, 2024
Copy link
Collaborator

@raon0211 raon0211 left a comment

Choose a reason for hiding this comment

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

Thanks! Seems to be much better.

@raon0211
Copy link
Collaborator

Seems that the new implementation is causing problems, let me check.

image

@dayongkr
Copy link
Collaborator

It looks like this issue has already been resolved through this PR, so I will close it.

Thank you for your contribution, and feel free to reopen it if you have any questions!

@dayongkr dayongkr closed this Mar 30, 2025
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.

3 participants