Skip to content

Commit

Permalink
feat: add x-origin property
Browse files Browse the repository at this point in the history
  • Loading branch information
aeworxet committed Mar 11, 2024
1 parent 6389f8e commit 682de39
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions src/util.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -145,8 +144,6 @@ 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`
export function addXOrigins(asyncapiDocument: AsyncAPIObject) {
// VALUE from 'asyncapiDocument' becomes KEY for the
// underlying and recursive functions
Expand Down

0 comments on commit 682de39

Please sign in to comment.