UNPKG

sicua

Version:

A tool for analyzing project structure and dependencies

18 lines (17 loc) 663 B
/** * Utility for detecting magic numbers in TypeScript/JavaScript code */ import ts from "typescript"; import { MagicNumber } from "../types/generalAnalyzer.types"; /** * Detects magic numbers in a TypeScript source file * @param sourceFile The TypeScript source file * @param filePath The full path to the file * @param getContextCode Function to get context lines around a node * @returns Array of detected magic numbers */ export declare function detectMagicNumbers(sourceFile: ts.SourceFile, filePath: string, getContextCode: (node: ts.Node, sourceFile: ts.SourceFile) => { before: string; line: string; after: string; }): MagicNumber[];