* Resolve the path eg. ```js resolvePath('path/to/some/dir/', '../../dir') //returns 'path/to/dir' ``` * @param {...string} paths
(...paths)
| 140 | * @param {...string} paths |
| 141 | */ |
| 142 | resolve(...paths) { |
| 143 | if (!paths.length) throw new Error("resolve(...path) : Arguments missing!"); |
| 144 | |
| 145 | let result = ""; |
| 146 | |
| 147 | paths.forEach((path) => { |
| 148 | if (path.startsWith("/")) { |
| 149 | result = path; |
| 150 | return; |
| 151 | } |
| 152 | |
| 153 | result = this.normalize(this.join(result, path)); |
| 154 | }); |
| 155 | |
| 156 | if (result.startsWith("/")) return result; |
| 157 | else return "/" + result; |
| 158 | }, |
| 159 | |
| 160 | /** |
| 161 | * Gets path for path2 relative to path1 |
no outgoing calls
no test coverage detected