alinea
Version:
Headless git-based CMS
28 lines (26 loc) • 644 B
JavaScript
import "../../chunks/chunk-NZLE2WMY.js";
// src/core/db/LinkResolver.ts
var LinkResolver = class {
constructor(resolver, ctx, locale) {
this.resolver = resolver;
this.ctx = ctx;
this.locale = locale;
}
includedAtBuild(filePath) {
return this.resolver.index.initialSync?.has(filePath) ?? false;
}
async resolveLinks(projection, entryIds) {
const { status, graph } = this.ctx;
const results = await this.resolver.resolve({
graph,
preferredLocale: this.locale ?? void 0,
status,
select: projection,
id: { in: entryIds }
});
return results;
}
};
export {
LinkResolver
};