@mintlify/prebuild
Version:
Helpful functions for Mintlify's prebuild step
8 lines (7 loc) • 474 B
JavaScript
import { CircularRefError, PathTraversalError, RefInvalidJsonError, RefNotFoundError, resolveRefs, } from '@mintlify/validation';
import { readFile } from 'fs/promises';
import path from 'path';
export { CircularRefError, PathTraversalError, RefInvalidJsonError, RefNotFoundError, resolveRefs };
export async function resolveFileRefs(value, contentDirectory) {
return resolveRefs(value, (relativePath) => readFile(path.join(contentDirectory, relativePath), 'utf-8'));
}