LiveScript
LiveScript copied to clipboard
How to get rid of surrounding paranthesis in compiled output?
By issuing this command:
$ echo {+x} | lsc -cpb --no-header
I get following result
({
x: true
});
but I need
{
x: true
}
Is there any way to do this without getting regex come into play?
$ echo {+x} | lsc -cpb --no-header --bare
Would you test your suggested code?
dont have bash.
Does echo {+x} | lsc -j come close enough? That gets you
{
"x": true
}
That works (does what I asked), thank you. But it turns out that this can be applied only JSON objects which don't include functions in them:
echo "{x: ->}" | lsc -cpb --no-header
outputs
({
x: function(){}
});
but
echo "{x: ->}" | lsc -cpb --no-header -j
outputs:
{}