preprocess
preprocess(
options):Promise<PreprocessedSpec>
Defined in: packages/speculator/src/preprocess/pipeline.ts:77
Preprocess a specification document
Loads configuration (if provided) and resolves all includes to produce a PreprocessedSpec ready for parsing.
Parameters
Section titled “Parameters”options
Section titled “options”Preprocess options
Returns
Section titled “Returns”Promise<PreprocessedSpec>
PreprocessedSpec with config and source
Throws
Section titled “Throws”PreprocessError on failure
Example
Section titled “Example”const spec = await preprocess({ entry: '/specs/my-spec/format.md', configPath: '/specs/my-spec/config.json', fileProvider: new NodeFileProvider(),});
// spec contains PreprocessedSpecfor (const unit of spec.source.units) { console.log(`Processing: ${unit.file}`);}