Skip to main content

Crate fresh_parser_js

Crate fresh_parser_js 

Source
Expand description

TypeScript to JavaScript transpilation using oxc

This module provides TypeScript transpilation using oxc_transformer for parsing, transformation, and code generation.

Functions§

bundle_module
Bundle a module and all its local imports into a single file with proper scoping Each module is wrapped in an IIFE that only exposes its exports
has_es_imports
Check if source contains ES module imports (import … from …) Kept for backwards compatibility
has_es_module_syntax
Check if source contains ES module syntax (imports or exports) This determines if the code needs bundling to work with QuickJS eval
strip_imports_and_exports
Strip import statements and export keywords from source using AST transformation Converts ES module syntax to plain JavaScript that QuickJS can eval
transpile_typescript
Transpile TypeScript source code to JavaScript