UNPKG

@elsikora/nestjs-crud-automator

Version:

A library for automating the creation of CRUD operations in NestJS.

19 lines (17 loc) 724 B
/** * Generates a formatted error string with the entity name * @param {TErrorStringProperties<T>} properties - The error string configuration options * @returns {string} The formatted error string with entity name substituted * @template T - The entity type */ function ErrorString(properties) { const entityName = properties.entity.name === undefined ? "UNKNOWN_RESOURCE" : properties.entity.name.toUpperCase(); if ("property" in properties) { return `${entityName}_${properties.type.replace("{property}", properties.property.toUpperCase())}`; } else { return properties.type.replace("{entity}", entityName); } } export { ErrorString }; //# sourceMappingURL=string.utility.js.map