I am working on a plugin where some of the parameters may contain arrays with a combination of numbers and strings.
Something like this works fine:
It gives me an array with ["My Audio Track", 80, 100] which is what I want.
But I also need to cater for the possibility that some of the content could be a nested array, such as this example for a font:
The first parameter could be just a string or an array of strings. The last could be just a number or an array of numbers.
Not really sure how to go about this one. Any suggestions? I'd like to keep it fairly short.
Something like this works fine:
Code:
var audioName = (params['Audio Name'] || '["My Audio Track", 80, 100]'
).replace(/[\[\]]/gi,'').split(",").map(function(value) {
return eval(value);
});
But I also need to cater for the possibility that some of the content could be a nested array, such as this example for a font:
Code:
[["Tahoma", "Verdana", "Calibri"], 24, true, [0, 255, 0, 200]]
["Tahoma", 24, true, 15]
Not really sure how to go about this one. Any suggestions? I'd like to keep it fairly short.
