* Bundles multiple roots (files/URLs/objects) into a single schema by creating a synthetic root * that references each input, resolving all externals, and then hoisting via the existing bundler.
({
arrayBuffer,
fetch,
pathOrUrlOrSchemas,
resolvedInputs,
}: {
arrayBuffer?: ArrayBuffer[];
fetch?: RequestInit;
pathOrUrlOrSchemas: Array<JSONSchema | string | unknown>;
resolvedInputs?: ResolvedInput[];
})
| 133 | * that references each input, resolving all externals, and then hoisting via the existing bundler. |
| 134 | */ |
| 135 | public async bundleMany({ |
| 136 | arrayBuffer, |
| 137 | fetch, |
| 138 | pathOrUrlOrSchemas, |
| 139 | resolvedInputs, |
| 140 | }: { |
| 141 | arrayBuffer?: ArrayBuffer[]; |
| 142 | fetch?: RequestInit; |
| 143 | pathOrUrlOrSchemas: Array<JSONSchema | string | unknown>; |
| 144 | resolvedInputs?: ResolvedInput[]; |
| 145 | }): Promise<JSONSchema> { |
| 146 | await this.parseMany({ arrayBuffer, fetch, pathOrUrlOrSchemas, resolvedInputs }); |
| 147 | this.mergeMany(); |
| 148 | |
| 149 | await resolveExternal(this, this.options); |
| 150 | const errors = JSONParserErrorGroup.getParserErrors(this); |
| 151 | if (errors.length) { |
| 152 | throw new JSONParserErrorGroup(this); |
| 153 | } |
| 154 | _bundle(this, this.options); |
| 155 | // Merged root is ready for bundling |
| 156 | |
| 157 | const errors2 = JSONParserErrorGroup.getParserErrors(this); |
| 158 | if (errors2.length) { |
| 159 | throw new JSONParserErrorGroup(this); |
| 160 | } |
| 161 | return this.schema!; |
| 162 | } |
| 163 | |
| 164 | /** |
| 165 | * Parses the given JSON schema. |
no test coverage detected