* Converts an absolute mounted path to a provider-relative POSIX path. * If not mounted, treats the path as already provider-relative. * @param {string} inputPath The path to convert * @returns {string}
(inputPath)
| 190 | * @returns {string} |
| 191 | */ |
| 192 | #toProviderPath(inputPath) { |
| 193 | if (this[kMounted] && this[kMountPoint]) { |
| 194 | const resolved = isAbsolute(inputPath) ? inputPath : resolvePath(inputPath); |
| 195 | if (!isUnderMountPoint(resolved, this[kMountPoint])) { |
| 196 | throw createENOENT('open', inputPath); |
| 197 | } |
| 198 | return getRelativePath(resolved, this[kMountPoint]); |
| 199 | } |
| 200 | return pathPosix.normalize(inputPath); |
| 201 | } |
| 202 | |
| 203 | /** |
| 204 | * Converts a provider-relative path back to a mounted path. |
no test coverage detected