* Encode path using encodeUriSegment, ignoring forward slashes * * @param {string} path Path to encode * @returns {string}
(path)
| 14449 | * @returns {string} |
| 14450 | */ |
| 14451 | function encodePath(path) { |
| 14452 | var segments = path.split('/'), |
| 14453 | i = segments.length; |
| 14454 | |
| 14455 | while (i--) { |
| 14456 | // decode forward slashes to prevent them from being double encoded |
| 14457 | segments[i] = encodeUriSegment(segments[i].replace(/%2F/g, '/')); |
| 14458 | } |
| 14459 | |
| 14460 | return segments.join('/'); |
| 14461 | } |
| 14462 | |
| 14463 | function decodePath(path, html5Mode) { |
| 14464 | var segments = path.split('/'), |
no test coverage detected