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

Don't use JSON.parse/stringify to clone. #440

Merged
merged 1 commit into from
Nov 7, 2016
Merged

Conversation

drhayes
Copy link
Contributor

@drhayes drhayes commented Oct 12, 2016

Fixes #439.

Uses the clone npm package to provide a deep clone. This probably has performance implications since JSON.parse(JSON.stringify(thing)) is super fast, but I don't think the original implementation meant to throw away Date and Symbol objects.

@ianp
Copy link

ianp commented Nov 4, 2016

You could call it as clone(message, true) to get better performance, because stringily/parse would fail with circular references in any case.

Other than that, this looks good to me to merge.

@benbrown benbrown merged commit 47ea1ef into howdyai:master Nov 7, 2016
@benbrown
Copy link
Contributor

benbrown commented Nov 7, 2016

Thanks @drhayes @ianp!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants