(path)
| 77 | * @return the Escaped path |
| 78 | */ |
| 79 | export function escapePathComponent(path) { |
| 80 | if (path.indexOf('/') === -1 && path.indexOf('~') === -1) |
| 81 | return path; |
| 82 | return path.replace(/~/g, '~0').replace(/\//g, '~1'); |
| 83 | } |
| 84 | /** |
| 85 | * Unescapes a json pointer path |
| 86 | * @param path The escaped pointer |
no outgoing calls
no test coverage detected
searching dependent graphs…