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