import { DocumentToObjectOptions , MongooseDocument } from "mongoose" ; export default class BaseService { toDtoObject < T > ( value , options ? ) { if ( ! value ) { return null ; } return value . toObject ( { versionKey : false , transform : ( doc , ret , options ) => { ret . id = doc . id ; delete ret . _id ; return ret ; } , ... options , } ) ; } }