This abstract Mapper
class provides a flexible and type-safe way to serialize, transform, and label AdonisJS Lucid models and their paginated results. It is designed to help you build clean API responses and DTOs in AdonisJS projects.
- Supports serialization of single models, arrays, and paginated results.
- Custom serialization logic via subclassing.
- Utility for picking specific fields and relations from models.
- Label mapping mechanism for enums or field names.
Use this utility to keep your API layer clean, consistent, and maintainable when working with AdonisJS and Lucid ORM.