diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-01-11 23:06:53 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-01-11 23:06:53 -0800 |
commit | c6d83e713df9864d704e2d12c3f62ff3be8535fd (patch) | |
tree | 42a87ab330dead626443722b401d91fa74083d6a /js/lib/common.js | |
parent | ffbca7b85198c2d0efd71b95ef4a1fa693578af0 (diff) |
Factored out normalizeURI into a single function in common.js.
This way we can change it without changing four separate places
in the code.
Diffstat (limited to 'js/lib/common.js')
-rw-r--r-- | js/lib/common.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/js/lib/common.js b/js/lib/common.js index e7cc13b..0104e68 100644 --- a/js/lib/common.js +++ b/js/lib/common.js @@ -27,4 +27,11 @@ var unescapeString = function(s) { } }; -module.exports = { unescapeString: unescapeString }; +var normalizeURI = function(uri) { + "use strict"; + return encodeURI(unescape(uri)); +} + +module.exports = { unescapeString: unescapeString, + normalizeURI: normalizeURI + }; |