Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy JSON only copies half of the JSON

I'm using Webstorm's debugger to inspect local variables for my Node application. However, when I right click on the variable I'm interested in and click Copy JSON, the pasted output only contains half of the JSON.

Has anyone experienced this issue and what did you do to resolve this? Yes, I could console.log the data or write it to a file, but I figured that using a debugger would be more efficient.

Thanks in advance, Q

like image 316
Quy Avatar asked Jan 20 '16 19:01

Quy


1 Answers

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.

like image 75
chriskelly Avatar answered Oct 20 '22 18:10

chriskelly