Skip to content

Commit

Permalink
refactor: 参数优化
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudcome committed Apr 15, 2023
1 parent 58508c7 commit 9f65bbf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/writers/BaseWriter.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { TypeAlias, TypeItem } from '../readers/types';
import { TypeAlias, TypeDocument, TypeItem } from '../readers/types';
import { StrictWriterOptions, WriterOptions } from './types';
import prettier from 'prettier';

export class BaseWriter {
static defaults: WriterOptions = {
document: { components: [], paths: [] },
prettier: {
singleQuote: true,
},
Expand All @@ -15,7 +14,7 @@ export class BaseWriter {
};

options: StrictWriterOptions;
constructor(options: WriterOptions) {
constructor(readonly document: TypeDocument, options?: WriterOptions) {
this.options = Object.assign({}, BaseWriter.defaults, options) as StrictWriterOptions;
}

Expand Down

0 comments on commit 9f65bbf

Please sign in to comment.