diff options
-rw-r--r-- | bugzillaBugTriage.js | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/bugzillaBugTriage.js b/bugzillaBugTriage.js index 0c21118..8a4f5f0 100644 --- a/bugzillaBugTriage.js +++ b/bugzillaBugTriage.js @@ -301,16 +301,12 @@ hlpr.addCSVValue = function addCSVValue(str, value) { }; // FIXME rewrite so that it doesn't break Eclipse -//hlpr.removeCSVValue = function removeCSVValue(str, value) { -// let parts = (str.trim().length > 0 ? str.split(",") : []); -// for each (let val in hlpr.valToArray(value)) { -// let pos = parts.indexOf(val); -// if (pos > -1) { -// parts.splice(pos, 1); -// } -// } -// return parts.join(","); -//}; +hlpr.removeCSVValue = function removeCSVValue(str, value) { + str = str.trim(); // we want it trimmed without any questions anyway + let parts = str ? str.split(",") : []; + parts = parts.filter(function(e,i,a) {return (e != value)}); + return parts.join(","); +}; /** * Check whether an item is member of the list. Idea is just to make long if |