deep extend (like jQuery's) for nodeJS

后端 未结 11 863
情歌与酒
情歌与酒 2020-12-13 17:27

I am struggling with deep copies of objects in nodeJS. my own extend is crap. underscore\'s extend is flat. there are rather simple extend variants here on stackexchange, bu

11条回答
  •  既然无缘
    2020-12-13 18:17

    It's already been ported. node-extend

    Note the project doesn't have tests and doesn't have much popularity, so use at your own risk.

    As mentioned you probably don't need deep copies. Try to change your data structures so you only need shallow copies.

    Few months later

    I wrote a smaller module instead, recommend you use xtend. It's not got an implementation containing jQuery baggage nor does it have bugs like node-extend does.

提交回复
热议问题