diff options
Diffstat (limited to 'app/assets/javascripts/lib/utils/text_utility.js')
-rw-r--r-- | app/assets/javascripts/lib/utils/text_utility.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/assets/javascripts/lib/utils/text_utility.js b/app/assets/javascripts/lib/utils/text_utility.js index 963041dd5d0..42f481261a2 100644 --- a/app/assets/javascripts/lib/utils/text_utility.js +++ b/app/assets/javascripts/lib/utils/text_utility.js @@ -568,3 +568,12 @@ export const humanizeBranchValidationErrors = (invalidChars = []) => { } return ''; }; + +/** + * Strips enclosing quotations from a string if it has one. + * + * @param {String} value String to strip quotes from + * + * @returns {String} String without any enclosure + */ +export const stripQuotes = (value) => value.replace(/^('|")(.*)('|")$/, '$2'); |