diff --git a/src/utils/trim.js b/src/utils/trim.js index 502f824a3a..87cc1c3182 100644 --- a/src/utils/trim.js +++ b/src/utils/trim.js @@ -1,10 +1,3 @@ module.exports = function trim(str) { - str = str.replace(/^\s+/, ''); - for (var i = str.length - 1; i >= 0; i--) { - if (/\S/.test(str.charAt(i))) { - str = str.substring(0, i + 1); - break; - } - } - return str; -}; \ No newline at end of file + return str.replace(/^\s+|\s+$/g, ''); +};