Skip to content

Commit

Permalink
Updating trim() polyfill. According to mdn: https://github.com/mdn/co…
Browse files Browse the repository at this point in the history
  • Loading branch information
catscarlet committed Sep 30, 2021
1 parent f3ca637 commit 6303809
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils.js
Expand Up @@ -185,7 +185,7 @@ function isURLSearchParams(val) {
* @returns {String} The String freed of excess whitespace
*/
function trim(str) {
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
}

/**
Expand Down

0 comments on commit 6303809

Please sign in to comment.