@elsikora/nestjs-crud-automator
Version:
A library for automating the creation of CRUD operations in NestJS.
14 lines (11 loc) • 604 B
JavaScript
;
/**
* Generates a unique cache key for DTO instances based on entity name, route method, DTO type, guard, and config.
* @param {IDtoGenerateCacheKey} key - The key object containing entity name, method, DTO type, guard name, and DTO config
* @returns {string} A unique string key for caching DTO instances
*/
function DtoGenerateCacheKey(key) {
return `${key.entityName}_${key.method}_${key.dtoType}_${key.guardName ?? "no-guard"}_${JSON.stringify(key.dtoConfig ?? {})}`;
}
exports.DtoGenerateCacheKey = DtoGenerateCacheKey;
//# sourceMappingURL=generate-cache-key.utility.js.map