Every line of 'encodeuricomponent nodejs' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
246 function strictEncodeURIComponent(string) { 247 // see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/encodeURIComponent 248 return encodeURIComponent(string) 249 .replace(/[!'()*]/g, escapeForDumbFirefox36) 250 .replace(/\*/g, "%2A"); 251 }
76 function encodeURIComponentPretty(str) { 77 return encodeURI(str).replace(/[\/?#]/g, function (c) { 78 return '%' + c.charCodeAt(0).toString(16).toUpperCase(); 79 }); 80 }