(entry: unknown, pkgName: string)
| 275 | * Exported for reuse across setup and doctor flows. |
| 276 | */ |
| 277 | export function matchesPluginEntry(entry: unknown, pkgName: string): boolean { |
| 278 | let candidate: string | null = null; |
| 279 | if (typeof entry === "string") candidate = entry; |
| 280 | else if (Array.isArray(entry) && typeof entry[0] === "string") candidate = entry[0]; |
| 281 | if (!candidate) return false; |
| 282 | if (candidate.startsWith("file://")) return false; |
| 283 | // Strip version tag: "@cortexkit/foo@latest" → "@cortexkit/foo" |
| 284 | const at = candidate.lastIndexOf("@"); |
| 285 | const head = at > 0 ? candidate.slice(0, at) : candidate; |
| 286 | return head === pkgName; |
| 287 | } |
| 288 | |
| 289 | function ensureDir(filePath: string): void { |
| 290 | const dir = dirname(filePath); |
no outgoing calls
no test coverage detected