* Encode path using encodeUriSegment, ignoring forward slashes * * @param {string} path Path to encode * @returns {string}
(path)
| 13764 | * @returns {string} |
| 13765 | */ |
| 13766 | function encodePath(path) { |
| 13767 | var segments = path.split('/'), |
| 13768 | i = segments.length; |
| 13769 | |
| 13770 | while (i--) { |
| 13771 | // decode forward slashes to prevent them from being double encoded |
| 13772 | segments[i] = encodeUriSegment(segments[i].replace(/%2F/g, '/')); |
| 13773 | } |
| 13774 | |
| 13775 | return segments.join('/'); |
| 13776 | } |
| 13777 | |
| 13778 | function decodePath(path, html5Mode) { |
| 13779 | var segments = path.split('/'), |
no test coverage detected