( node: nga.ExpressionValueMetadata, fileName: string, content?: string, )
| 431 | } |
| 432 | |
| 433 | function adaptSourceNode( |
| 434 | node: nga.ExpressionValueMetadata, |
| 435 | fileName: string, |
| 436 | content?: string, |
| 437 | ): SourceNode { |
| 438 | const sourceSpan = createSpan(fileName, node.sourceSpan.start, node.sourceSpan.end); |
| 439 | const source = content ? content.substring(node.sourceSpan.start, node.sourceSpan.end) : ''; |
| 440 | |
| 441 | if (isStaticSourceNode(node)) { |
| 442 | return { |
| 443 | kind: node.kind === 'string' ? 'string' : 'identifier', |
| 444 | text: node.text, |
| 445 | source, |
| 446 | sourceSpan, |
| 447 | } satisfies StaticSourceNode; |
| 448 | } |
| 449 | |
| 450 | return {kind: 'unspecified', sourceSpan} satisfies SourceNode; |
| 451 | } |
| 452 | |
| 453 | function declarationToMetadata( |
| 454 | decl: nga.DeclarationMetadata, |
no test coverage detected