mirror of
https://github.com/tenrok/axios.git
synced 2026-05-15 11:59:42 +03:00
Updating trim() polyfill. According to mdn: https://github.com/mdn/content/blob/cf607d68522cd35ee7670782d3ee3a361eaef2e4/files/en-us/web/javascript/reference/global_objects/string/trim/index.md (#4072)
Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
+1
-1
@@ -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, '');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user