import { DocumentToObjectOptions , Document } from 'mongoose' ; type Model < T > = T & Document ; param from param options export function ensureMongoToObject < T extends Object > ( from , options ? ) { if ( 'toObject' in from && typeof from . toObject === 'function' ) { return from . toObject ( options ) ; } else { return from ; } }