node-copy-paste icon indicating copy to clipboard operation
node-copy-paste copied to clipboard

copy function in Object is not working

Open iLikeStar opened this issue 2 years ago • 1 comments

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

iLikeStar avatar Mar 10 '23 02:03 iLikeStar

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.

xavi- avatar May 27 '23 03:05 xavi-