* Returns the file system that the path points to.
(path: string)
| 136 | * Returns the file system that the path points to. |
| 137 | */ |
| 138 | public _getFs(path: string): {fs: FileSystem; path: string} { |
| 139 | const mountList = this.mountList, len = mountList.length; |
| 140 | for (let i = 0; i < len; i++) { |
| 141 | const mountPoint = mountList[i]; |
| 142 | // We know path is normalized, so it is a substring of the mount point. |
| 143 | if (mountPoint.length <= path.length && path.indexOf(mountPoint) === 0) { |
| 144 | path = path.substr(mountPoint.length > 1 ? mountPoint.length : 0); |
| 145 | if (path === '') { |
| 146 | path = '/'; |
| 147 | } |
| 148 | return {fs: this.mntMap[mountPoint], path: path}; |
| 149 | } |
| 150 | } |
| 151 | // Query our root file system. |
| 152 | return {fs: this.rootFs, path: path}; |
| 153 | } |
| 154 | |
| 155 | // Global information methods |
| 156 |
no outgoing calls
no test coverage detected