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_FUNCTION_KINDS
JS_TYPE_KINDS
NESTING_NODES
PUBLIC_SYMBOL_KINDS
SCOPE_CREATING_KINDS
TS_CONTAINER_KINDS
TS_FUNCTION_KINDS
TS_TYPE_KINDS

Functions§

build_signature
Build signature for a JS/TS function, method, or class node.
extract_decorators
Extract decorator attributes (@decorator) preceding a node.
extract_implements
Extract implements/extends list for a JS/TS class or interface node.
extract_imports
Extract imports from an import_statement node.
extract_js_module_doc
Extract the file-level JSDoc comment from JavaScript/TypeScript source.
extract_jsdoc
Extract a JSDoc comment (/** ... */) preceding a node.
format_import
Format an import as JavaScript/TypeScript source code.
get_visibility
Get visibility for a JS/TS class member.