1.2.2 • Published 10 months ago
@mapreedev/entity v1.2.2
@mapreedev/entity
Usage
import { BaseEntity } from "@mapreedev/entity";
type IExampleEntityCache = {
username: string;
id: string;
hasPassword?: boolean;
}
type IExampleEntityDatabase = {
username: string;
id: string;
password?: string;
}
const exampleEntity = new BaseEntity<IExampleEntityCache,IExampleEntityDatabase>({
processor({ password, ...entity }){
return{
hasPassword: !!password,
...entity,
}
}
})
// Now just use the entity with the methods provided
Rework
- ACID
- Prisma like methods
- CRUD on Indexes
- Custom errors
- Optional database repository too
- L3 Constructor for configure