* Encode path using encodeUriSegment, ignoring forward slashes * * @param {string} path Path to encode * @returns {string}
(path)
| 13801 | * @returns {string} |
| 13802 | */ |
| 13803 | function encodePath(path) { |
| 13804 | var segments = path.split('/'), |
| 13805 | i = segments.length; |
| 13806 | |
| 13807 | while (i--) { |
| 13808 | // decode forward slashes to prevent them from being double encoded |
| 13809 | segments[i] = encodeUriSegment(segments[i].replace(/%2F/g, '/')); |
| 13810 | } |
| 13811 | |
| 13812 | return segments.join('/'); |
| 13813 | } |
| 13814 | |
| 13815 | function decodePath(path, html5Mode) { |
| 13816 | var segments = path.split('/'), |
no test coverage detected