(a: string)
| 215 | * @returns |
| 216 | */ |
| 217 | export const getParentFolder = (a: string) => { |
| 218 | const b = path.posix.dirname(a); |
| 219 | if (b === "." || b === "/") { |
| 220 | // the root |
| 221 | return "/"; |
| 222 | } |
| 223 | if (b.endsWith("/")) { |
| 224 | return b; |
| 225 | } |
| 226 | return `${b}/`; |
| 227 | }; |
| 228 | |
| 229 | /** |
| 230 | * https://stackoverflow.com/questions/54511144 |
no outgoing calls
no test coverage detected