Is this chunk a type-like declaration worth pulling as a dependency?
(symbol: string | undefined, file: string)
| 55 | |
| 56 | /** Is this chunk a type-like declaration worth pulling as a dependency? */ |
| 57 | function isTypeChunk(symbol: string | undefined, file: string): boolean { |
| 58 | if (TYPE_FILE_RE.test(file)) return true; |
| 59 | if (!symbol) return false; |
| 60 | return TYPE_SYMBOL_RE.test(symbol) || /Props|Type|Interface|Schema|Options|Config|State/.test(symbol); |
| 61 | } |
| 62 | |
| 63 | /** Extract just the signature (declaration line through the opening brace) of a chunk. */ |
| 64 | function signatureOf(text: string): string { |