I got a result like this :
const result = [ 'arg', 'arg2', '[opt1, opt2]' ]
How can I check in this array if a string can be a array ('[opt1, opt2]') and formate it in real array ?
Thank you
EDIT :
I explain all problem :
I want create a script :
yarn start arg1 arg2 "[option1, option2]"
I need a array of options but I can have a lot args without restrictions, when I recover the result :
const res = process.argv.slice(2)
How can I find my array of options ?