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

40 lines 886 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BaseEntity = void 0; const uuid_1 = require("uuid"); /** * Base entity class with ID and timestamps */ class BaseEntity { _id; _createdAt; _updatedAt; constructor(id) { this._id = id ?? (0, uuid_1.v4)(); this._createdAt = new Date(); this._updatedAt = new Date(); } get id() { return this._id; } get createdAt() { return this._createdAt; } get updatedAt() { return this._updatedAt; } touch() { this._updatedAt = new Date(); } equals(entity) { if (!entity) { return false; } if (this === entity) { return true; } return this._id === entity._id; } } exports.BaseEntity = BaseEntity; //# sourceMappingURL=BaseEntity.js.map