@elsikora/nestjs-crud-automator
Version:
A library for automating the creation of CRUD operations in NestJS.
18 lines (15 loc) • 666 B
JavaScript
import { AUTO_CONTEXT_DTO_CONSTANT } from '../../constant/dto/auto-context.constant.js';
/**
* Retrieves stored DTO auto-context (route method + dto type) for a generated DTO prototype.
* @param {object} target - DTO prototype that may contain context metadata.
* @returns {IDtoAutoContextMetadata | undefined} Stored context metadata if available.
*/
function GetAutoDtoContext(target) {
const stack = Reflect.getMetadata?.(AUTO_CONTEXT_DTO_CONSTANT.METADATA_KEY, target);
if (!stack || stack.length === 0) {
return undefined;
}
return stack.at(-1);
}
export { GetAutoDtoContext };
//# sourceMappingURL=auto-dto-context.utility.js.map