Skip to content
New issue

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

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

Already on GitHub? # to your account

Support for Map and Set types #17

Closed
derekparsons718 opened this issue Nov 12, 2020 · 1 comment · Fixed by #23
Closed

Support for Map and Set types #17

derekparsons718 opened this issue Nov 12, 2020 · 1 comment · Fixed by #23

Comments

@derekparsons718
Copy link

I would love to see support added for the native Map and Set types.

They are becoming increasingly popular and I use them all the time. But the current behavior when cloning them is to return an empty object:

const data = {
    set: new Set([1, 2, 3]),
    map: new Map([
        ["a", 1],
        ["b", 2],
        ["c", 3]
    ])
};
console.log(data); // {set: {1, 2, 3}, map: {"a" => 1, "b" => 2, "c" => 3}}
console.log(clone(data)); // {set: {}, map: {}}
@davidmarkclements
Copy link
Owner

PR's for this are more than welcome!

JammSpread added a commit to JammSpread/rfdc that referenced this issue Mar 13, 2021
Adds deepcloning functionality for Set and Map classes.
Related to: davidmarkclements#17

Signed-off-by: JK <u.sslooky@gmail.com>
JammSpread added a commit to JammSpread/rfdc that referenced this issue Mar 13, 2021
Adds standalone and nested tests for sets and maps.

Related to: davidmarkclements#17

Signed-off-by: JK <u.sslooky@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants