diff --git a/Scripts/addQuotesToCommaSeparatedList.js b/Scripts/addQuotesToCommaSeparatedList.js new file mode 100644 index 0000000..47b46c4 --- /dev/null +++ b/Scripts/addQuotesToCommaSeparatedList.js @@ -0,0 +1,17 @@ +/** + { + "id": "co.perlovs.Esse.ExternalFunctions.addQuotesToCommaSeparatedList", + "name":"Add Quotes to a Comma Separated List", + "description":"Takes in a comma-separated list and adds single quotes around each item", + "category":"Convert", + "author":"Perlovs", + } +**/ + +function main(input) { + if (input !== '') { + return "'" + input.split(',').map(s => s.trim()).join("','") + "'"; + } + + return input +} \ No newline at end of file