Skip to content

fix: add interface Options, remove pre-validation with Parser #188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.6.2",
"description": "Bundle references from an single AsyncAPI document into a single file.",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"types": "lib/types.d.ts",
"scripts": {
"build": "tsc",
"test": "jest",
Expand Down
2 changes: 1 addition & 1 deletion src/document.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import yaml from 'js-yaml';

import type { AsyncAPIObject } from './spec-types';
import type { AsyncAPIObject } from './types';

/**
* @class
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {

import { Document } from './document';

import type { AsyncAPIObject } from './spec-types';
import type { AsyncAPIObject, Options } from './types';

// remember the directory where execution of the program started
const originDir = String(process.cwd());
Expand Down Expand Up @@ -89,7 +89,7 @@ const originDir = String(process.cwd());
*/
export default async function bundle(
files: string[] | string,
options: any = {}
options: Options = {}
) {
let bundledDocument: any = {};
let validationResult: any = [];
Expand Down
4 changes: 2 additions & 2 deletions src/parser.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import $RefParser from '@apidevtools/json-schema-ref-parser';

import type { ParserOptions as $RefParserOptions } from '@apidevtools/json-schema-ref-parser';
import type { AsyncAPIObject } from 'spec-types';
import type { AsyncAPIObject, Options as BundlerOptions } from './types';

let RefParserOptions: $RefParserOptions;

Expand All @@ -15,7 +15,7 @@ let RefParserOptions: $RefParserOptions;
export async function parse(
JSONSchema: AsyncAPIObject,
specVersion: number,
options: any = {}
options: BundlerOptions = {}
) {
/* eslint-disable indent */
// It is assumed that there will be major Spec versions 4, 5 and on.
Expand Down
Loading
Loading