Documentation
¶
Overview ¶
Package typescript provides centralized TypeScript patterns for semantic analysis
Index ¶
- Variables
- func BuildDecoratorPattern(decoratorPattern string) *regexp.Regexp
- func BuildPropertyPattern(pattern string) *regexp.Regexp
- func BuildThisPropertyAssignPattern(paramName string) *regexp.Regexp
- func ExtractBracketKey(expr string) string
- func ExtractRequestChainProperty(expr string) (string, string)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ThisPropertyAssignPattern matches this.property = ... // Used to detect constructor parameter flow to properties ThisPropertyAssignPattern = regexp.MustCompile(`this\.(\w+)\s*=`) // BracketKeyAccessPattern matches ['key'], ["key"], or [`key`] (template literal) // Used to extract keys from bracket notation including template literals BracketKeyAccessPattern = regexp.MustCompile(`\[['"\x60](\w+)['"\x60]\]`) // RequestPropertyChainPattern matches .body.prop, .query.prop, .params.prop, etc. // Used to extract nested property access on request objects RequestPropertyChainPattern = regexp.MustCompile(`\.(body|query|params|headers|cookies)\.(\w+)`) // DecoratorPatternPrefix is the prefix for TypeScript/NestJS decorators DecoratorPatternPrefix = `@` )
Functions ¶
func BuildDecoratorPattern ¶
BuildDecoratorPattern creates a pattern for @decoratorName(
func BuildPropertyPattern ¶
BuildPropertyPattern creates a pattern for .propertyName with word boundary
func BuildThisPropertyAssignPattern ¶
BuildThisPropertyAssignPattern creates a pattern for this.property = ... paramName
func ExtractBracketKey ¶
ExtractBracketKey extracts the key from bracket notation ['key'], ["key"], or [`key`]
func ExtractRequestChainProperty ¶
ExtractRequestChainProperty extracts the property from request.body.prop style access Returns (category, property) e.g., ("body", "userId")
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.