Metastatic. Adapters. JavaScript. ToMeta
(Metastatic v0.24.1)
View Source
Regex-based source-to-MetaAST conversion for JavaScript and TypeScript.
Performs single-pass line-by-line scanning to extract structural information
from JS/TS source code, producing a proper MetaAST tree wrapped in a
:container node for the file module.
Extraction Strategy
Each line is scanned in priority order:
- Import statements (
import ... fromandrequire(...)) - Class declarations (ES6
class) - Function declarations, arrow functions, and class methods
- Function call expressions
TypeScript Handling
TypeScript type annotations are stripped before parameter counting:
- Generic type parameters:
<T, U extends Foo> - Parameter type annotations:
name: Type,name?: Type
Summary
Functions
Parse JavaScript/TypeScript source into a MetaAST tree.