( filePath: string )
| 142 | } |
| 143 | |
| 144 | async function getSkillItemByFilePath( |
| 145 | filePath: string |
| 146 | ): Promise<SkillItem | null> { |
| 147 | if (getResourceType(filePath) !== "skill") return null; |
| 148 | |
| 149 | const skillsData = await getSkillsData(); |
| 150 | if (!skillsData) return null; |
| 151 | |
| 152 | const rootPath = getSkillRootPath(filePath); |
| 153 | if (!rootPath) return null; |
| 154 | |
| 155 | return ( |
| 156 | skillsData.items.find( |
| 157 | (item) => |
| 158 | item.path === rootPath || |
| 159 | item.skillFile === filePath || |
| 160 | item.files.some((file) => file.path === filePath) |
| 161 | ) || null |
| 162 | ); |
| 163 | } |
| 164 | |
| 165 | function updateModalTitle(titleText: string, filePath: string): void { |
| 166 | const title = document.getElementById("modal-title"); |
no test coverage detected