UNPKG

ravendb

Version:
27 lines 751 B
import { Lazy } from "../../Lazy.js"; export class LazyMultiLoaderWithInclude { _session; _includes = []; constructor(session) { this._session = session; } /** * Includes the specified path. */ include(path) { this._includes.push(path); return this; } load(ids, clazz) { const isMultiple = Array.isArray(ids); const result = this._session.lazyLoadInternal(isMultiple ? ids : [ids], this._includes, clazz); if (isMultiple) { return result; } return new Lazy(async () => { const x = await result.getValue(); return x[Object.keys(x)[0]]; }); } } //# sourceMappingURL=LazyMultiLoaderWithInclude.js.map