es-toolkit icon indicating copy to clipboard operation
es-toolkit copied to clipboard

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

Open ShaoClean opened this issue 1 year ago • 2 comments

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 avatar Aug 23 '24 07:08 ShaoClean

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

vercel[bot] avatar Aug 23 '24 07:08 vercel[bot]

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

image

raon0211 avatar Aug 25 '24 13:08 raon0211

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 avatar Mar 30 '25 08:03 dayongkr