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 and jasonsaayman committed May 4, 2022
1 parent e8e4749 commit 5affc9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils.js
Expand Up @@ -210,7 +210,7 @@ var isURLSearchParams = kindOfTest('URLSearchParams');
* @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 5affc9d

Please sign in to comment.