(path: string)
| 19 | * @returns - Root URL of the Directus instance |
| 20 | */ |
| 21 | export function extractRoot(path: string) { |
| 22 | const parts = path.split('/'); |
| 23 | const adminIndex = parts.indexOf('admin'); |
| 24 | const rootPath = parts.slice(0, adminIndex).join('/') + '/'; |
| 25 | return rootPath; |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * Extract the path of the admin app from a given input path/url |
no test coverage detected