( filePath: string, collectionName: string )
| 118 | } |
| 119 | |
| 120 | function getCollectionRootPath( |
| 121 | filePath: string, |
| 122 | collectionName: string |
| 123 | ): string | null { |
| 124 | const segments = filePath.split("/"); |
| 125 | const collectionIndex = segments.indexOf(collectionName); |
| 126 | if (collectionIndex === -1 || segments.length <= collectionIndex + 1) { |
| 127 | return null; |
| 128 | } |
| 129 | return segments.slice(0, collectionIndex + 2).join("/"); |
| 130 | } |
| 131 | |
| 132 | function getSkillRootPath(filePath: string): string | null { |
| 133 | return getCollectionRootPath(filePath, "skills"); |
no outgoing calls
no test coverage detected