* Encode path using encodeUriSegment, ignoring forward slashes * * @param {string} path Path to encode * @returns {string}
(path)
| 14384 | * @returns {string} |
| 14385 | */ |
| 14386 | function encodePath(path) { |
| 14387 | var segments = path.split('/'), |
| 14388 | i = segments.length; |
| 14389 | |
| 14390 | while (i--) { |
| 14391 | // decode forward slashes to prevent them from being double encoded |
| 14392 | segments[i] = encodeUriSegment(segments[i].replace(/%2F/g, '/')); |
| 14393 | } |
| 14394 | |
| 14395 | return segments.join('/'); |
| 14396 | } |
| 14397 | |
| 14398 | function decodePath(path, html5Mode) { |
| 14399 | var segments = path.split('/'), |
no test coverage detected