Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ts-morph-helpers

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-morph-helpers

Helpers for ts-morph

  • 0.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.8K
increased by3.37%
Maintainers
1
Weekly downloads
 
Created
Source

Helpers for ts-morph

Helpers for ts-morph.

List

experimental/findJsxIdentifiersInJsxExpressions
experimental/findJsxSymbolsInJsxExpressions
experimental/getRealSourceFilesForImportDeclarations
experimental/getReferencedSourceFiles
experimental/hasSymbol
experimental/isBarrel
expressions/findCallExpressionsByName
expressions/findCallExpressionsWithArg
file/getRealSourceFileForImportDeclaration
file/getSourceFilesForNodes
jsx/findJsxNodeByName
jsx/findJsxNodes
jsx/isJsx
module/findDuplicateExportedNames
module/findExportDeclarationByIdentifier
module/findExportDeclarationByName
module/findExportIdentifierByName
module/findExportSpecifierByName
module/findImportIdentifierByName
module/findImportSpecifierByName
module/getImportDeclarationsForSymbols
node/getDeclarationsForSymbols
node/getSymbolsOfNodes
react/findContextProviderIdentifierByContextName
react/findHookCallExpressions
react/findHookIdentifierByContextName

Naming Is Hard

Terminology

When looking at this example code...

import { a } from './a';
import { b } from 'b';
const c = a + b;
const d = b(c);
export { c };

...we can apply the following (incomplete) list of terms:

NameDescriptionExample
SymbolNamed declaration, connects declaration nodes.a, b, c, d
IdentifierNode, references a symbola (2x), b (3x), c (2x), d (1x)
SpecifierMore specific classification of identifierImportSpecifier a, ExportSpecifier c
Call expressionFunction call with argumentsb(c)
Import declarationAn import declaration with named and/or default importsimport { b } from 'b'
Export declarationAn export declaration with named (not default) exportsexport { b } from 'b'

Here is the example code in the TypeScript AST Viewer to see the nodes as described.

Additional terminology

  • SourceFile: The AST of a given source file
  • Program: Collection of source files, and its main entry

Conventions

The following conventions are used to name the helper functions:

  • To get something means the thing is a reference expected to be there (upwards and/or linked).
  • To find something means to query for things from a certain starting point (downwards).
  • To get things For something expresses an AncestorForDescendant hierarchy.
  • To get things Of something means the opposite: descendantOfAncestor.

FAQs

Package last updated on 30 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc