Skip to content

Commit

Permalink
Merge pull request #2 from mishamsk/master
Browse files Browse the repository at this point in the history
new external script to adds quotes to comma-separated lists
  • Loading branch information
melonamin authored May 1, 2021
2 parents 91ecee4 + e53c549 commit 289ef41
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Scripts/addQuotesToCommaSeparatedList.js
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 289ef41

Please sign in to comment.