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

copy function in Object is not working #70

Open
iLikeStar opened this issue Mar 10, 2023 · 1 comment
Open

copy function in Object is not working #70

iLikeStar opened this issue Mar 10, 2023 · 1 comment

Comments

@iLikeStar
Copy link

const ncp = require('copy-paste')
ncp.copy({
x: function(y){return y}
})

expected:
{x: function(y){return y}}

actual output:
{ x: [Function: x] }

hoping to fix it

@xavi-
Copy link
Owner

xavi- commented May 27, 2023

This is because copy is using node's built in util.inspect to convert objects to strings. This bug is in the unfortunate "real, but non-trivial to fix and not commonly experienced" category, so I'm going to punt until more people ask for a fix or if someone provides a PR.

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

No branches or pull requests

2 participants