* Extract file extension from a glob pattern
(pattern)
| 361 | * Extract file extension from a glob pattern |
| 362 | */ |
| 363 | function extractExtensionFromPattern(pattern) { |
| 364 | // Match patterns like **.ts, **/*.js, *.py, etc. |
| 365 | const match = pattern.match(/\*\.(\w+)$/); |
| 366 | if (match) return `.${match[1]}`; |
| 367 | |
| 368 | // Match patterns like **/*.{ts,tsx} |
| 369 | const braceMatch = pattern.match(/\*\.\{([^}]+)\}$/); |
| 370 | if (braceMatch) { |
| 371 | return braceMatch[1].split(",").map((ext) => `.${ext.trim()}`); |
| 372 | } |
| 373 | |
| 374 | return null; |
| 375 | } |
| 376 | |
| 377 | /** |
| 378 | * Generate instructions metadata |
no outgoing calls
no test coverage detected