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 }
Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code
76 function encodeURIComponentPretty(str) { 77 return encodeURI(str).replace(/[\/?#]/g, function (c) { 78 return '%' + c.charCodeAt(0).toString(16).toUpperCase(); 79 }); 80 }