ramda icon indicating copy to clipboard operation
ramda copied to clipboard

clone does not clone error instance

Open 5d-jh opened this issue 2 years ago • 4 comments

const target =new Error();
const cloned = clone(target);

// actual
target === cloned // true

//expected
target === cloned // false

5d-jh avatar Jul 03 '23 03:07 5d-jh

Hello @5d-jh ! Ya, we do not attempt to handle Error: https://github.com/ramda/ramda/blob/afe98b03c322fc4d22742869799c9f2796c79744/source/internal/_clone.js#L40

Looks like lodash just returns a plain Object with some properties set. Similar with a couple other deep clone type packages I saw.

Seems to me like creating a new Error with some properties set on it would be better? Would you like to submit a PR?

kedashoe avatar Jul 03 '23 21:07 kedashoe

Sure. I will handle this issue

5d-jh avatar Jul 04 '23 07:07 5d-jh

Hi everyone, how is this issue progressing?

I wanted to start contributing to the project, can I start with this issue?

richecr avatar Jun 03 '24 01:06 richecr

@richecr sounds good, go for it!

kedashoe avatar Jun 03 '24 02:06 kedashoe