UNPKG

@samiyev/guardian

Version:

Research-backed code quality guardian for AI-assisted development. Detects hardcodes, secrets, circular deps, framework leaks, entity exposure, and 9 architecture violations. Enforces Clean Architecture/DDD principles. Works with GitHub Copilot, Cursor, W

57 lines 1.83 kB
import { FolderRegistry } from "./FolderRegistry"; /** * Analyzes file paths and imports to extract aggregate information * * Handles path normalization, aggregate extraction, and entity name detection * for aggregate boundary validation. */ export declare class AggregatePathAnalyzer { private readonly folderRegistry; constructor(folderRegistry: FolderRegistry); /** * Extracts the aggregate name from a file path * * Handles patterns like: * - domain/aggregates/order/Order.ts → 'order' * - domain/order/Order.ts → 'order' * - domain/entities/order/Order.ts → 'order' */ extractAggregateFromPath(filePath: string): string | undefined; /** * Extracts the aggregate name from an import path */ extractAggregateFromImport(importPath: string): string | undefined; /** * Extracts the entity name from an import path */ extractEntityName(importPath: string): string | undefined; /** * Normalizes a file path for consistent processing */ private normalizePath; /** * Gets path segments after the 'domain' folder */ private getPathSegmentsAfterDomain; /** * Finds aggregate name in path segments after domain folder */ private findAggregateInSegments; /** * Extracts aggregate from entity folder structure */ private extractFromEntityFolder; /** * Finds aggregate in import path segments */ private findAggregateInImportSegments; /** * Finds aggregate after 'domain' or 'aggregates' folder in import */ private findAggregateAfterDomainFolder; /** * Extracts aggregate from second-to-last segment if applicable */ private findAggregateFromSecondLastSegment; } //# sourceMappingURL=AggregatePathAnalyzer.d.ts.map