diff --git a/src/index.ts b/src/index.ts index f357e84..8b67b21 100644 --- a/src/index.ts +++ b/src/index.ts @@ -98,7 +98,7 @@ export default async function bundle(files: string[], options: any = {}) { resolvedJsons = await resolve(parsedJsons, options); } - return new Document(resolvedJsons as AsyncAPIObject[], options.base); + return new Document(resolvedJsons, options.base); } // 'module.exports' is added to maintain backward compatibility with Node.js diff --git a/src/util.ts b/src/util.ts index 637932c..b7d05d3 100644 --- a/src/util.ts +++ b/src/util.ts @@ -1,7 +1,6 @@ import fs from 'fs'; -import $RefParser from '@apidevtools/json-schema-ref-parser'; import axios from 'axios'; -import { cloneDeep, merge } from 'lodash'; +import { merge } from 'lodash'; import yaml from 'js-yaml'; import { parse } from './parser'; import { ParserError } from './errors'; @@ -145,8 +144,7 @@ export function resolveBaseFileDir(file: object, baseFileDir: string) { ); } -// Moved 'addXOrigins' to the beginning of the scope to avoid an ESLint's error -// `'addXOrigins' was used before it was defined` +// eslint-disable-next-line export function addXOrigins(asyncapiDocument: AsyncAPIObject) { // VALUE from 'asyncapiDocument' becomes KEY for the // underlying and recursive functions