js-object-to-json icon indicating copy to clipboard operation
js-object-to-json copied to clipboard

Problem converting data that has functions inside

Open rvalitov opened this issue 2 years ago • 2 comments

Hi! Thank you for you project! I hope it can help me to parse data from a JS file. I have a following example of JS data:

var some_data = {data: s("London")};

where s is a translation function used in JS code. I need to get an array or PHP object from that. Unfortunately, such code can't be processed with the json_decode function that you use under the hood. It says Syntax Error. If I call convertToJson I get:

{"data":"s(""London")}

Double quote appears, which should not be there. Do you think if there's any workaround for that?

rvalitov avatar May 18 '22 14:05 rvalitov