复制JSON只复制JSON的一半

时间:2016-01-20 19:42:01

标签: node.js webstorm

我正在使用Webstorm的调试器来检查我的Node应用程序的局部变量。但是,当我右键单击我感兴趣的变量并单击Copy JSON时,粘贴的输出只包含一半的JSON。

有没有人遇到过这个问题,你做了什么来解决这个问题?是的,我可以console.log数据或将其写入文件,但我认为使用调试器会更有效。

提前致谢, Q

1 个答案:

答案 0 :(得分:6)

Yes, I have seen this too. Not sure what causes it. Here is a workaround:

Try switching to the console tab and saving variable out as a JSON string as follows:

JSON.stringify(myvar);

Then copy the results and, if necessary, parse it elsewhere with:

JSON.parse('..data goes here..')

Don't forget to use single quotes because the JSON contains double quotes everywhere.