Skip to main content

Module ecmascript

Module ecmascript 

Source
Expand description

Shared ECMAScript (JavaScript/TypeScript) support functions.

This module contains common logic shared between JavaScript, TypeScript, and TSX. Each language struct delegates to these functions for DRY implementation.

Constants§

COMPLEXITY_NODES
CONTROL_FLOW_KINDS
IMPORT_KINDS
JS_CONTAINER_KINDS
JS_EXTENSIONS
JS_FUNCTION_KINDS
JS_TYPE_KINDS
NESTING_NODES
PUBLIC_SYMBOL_KINDS
SCOPE_CREATING_KINDS
TS_CONTAINER_KINDS
TS_EXTENSIONS
TS_FUNCTION_KINDS
TS_TYPE_KINDS

Functions§

extract_container
Extract a class or interface container symbol from a node.
extract_function
Extract a function/method symbol from a node.
extract_imports
Extract imports from an import_statement node.
extract_public_symbols
Extract exports from an export_statement node.
extract_type
Extract a TypeScript type symbol (interface, type alias, enum).
find_deno_cache
Find Deno cache directory.
find_node_modules
Find node_modules directory by walking up from a file.
find_package_cache
Find the node_modules directory.
find_package_entry
Find entry point for a JavaScript/TypeScript package. Checks package.json for module/main fields, falls back to index.{js,mjs,cjs,ts}.
format_import
Format an import as JavaScript/TypeScript source code.
get_deno_version
Get Deno version.
get_node_version
Get Node.js version (for index versioning).
get_version
Get the Node.js version.
resolve_deno_import
Resolve a Deno URL import to its cached location.
resolve_external_import
Resolve an external (node_modules) import.
resolve_local_import
Resolve a relative import to a local file path.