I would like to allow users to specify JavaScript object in a HTML textarea which I would then parse. But JSON looks too strict for me, requiring only "
as quotes, and quotes everywhere. I would like that you could specify the object in ways you can specify it in JavaScript, and then parse it. How could I parse such string (in JavaScript itself)? Is there a library for it?
I know that I could use eval
, but I would not like to allow custom code to run, just static object definition.
I am trying to provide a simple way for users to write MongoDB query.