2014-10-10 18:54:07 +04:00
|
|
|
// # Encode Helper
|
|
|
|
//
|
|
|
|
// Usage: `{{encode uri}}`
|
|
|
|
//
|
|
|
|
// Returns URI encoded string
|
|
|
|
|
2019-04-22 18:54:42 +03:00
|
|
|
const {SafeString} = require('./proxy');
|
2014-10-10 18:54:07 +04:00
|
|
|
|
2017-04-04 19:07:35 +03:00
|
|
|
module.exports = function encode(string, options) {
|
2019-04-22 18:54:42 +03:00
|
|
|
const uri = string || options;
|
2017-04-04 19:07:35 +03:00
|
|
|
return new SafeString(encodeURIComponent(uri));
|
2014-10-10 18:54:07 +04:00
|
|
|
};
|