npm run prettier

This commit is contained in:
Zachary Whaley 2021-07-20 12:17:09 -05:00
parent 196a2a0912
commit 58b549763c
3 changed files with 9 additions and 6 deletions

View File

@ -28,7 +28,10 @@ export class SpecStore {
this.externalDocs = this.parser.spec.externalDocs; this.externalDocs = this.parser.spec.externalDocs;
this.contentItems = MenuBuilder.buildStructure(this.parser, this.options); this.contentItems = MenuBuilder.buildStructure(this.parser, this.options);
this.securitySchemes = new SecuritySchemesModel(this.parser); this.securitySchemes = new SecuritySchemesModel(this.parser);
const webhookPath: Referenced<OpenAPIPath> = {...this.parser?.spec?.['x-webhooks'], ...this.parser?.spec.webhooks}; const webhookPath: Referenced<OpenAPIPath> = {
...this.parser?.spec?.['x-webhooks'],
...this.parser?.spec.webhooks,
};
this.webhooks = new WebhookModel(this.parser, options, webhookPath); this.webhooks = new WebhookModel(this.parser, options, webhookPath);
} }
} }

View File

@ -54,8 +54,8 @@ describe('Models', () => {
license: { license: {
name: 'MIT', name: 'MIT',
identifier: 'MIT', identifier: 'MIT',
url: 'https://opensource.org/licenses/MIT' url: 'https://opensource.org/licenses/MIT',
} },
}, },
} as any; } as any;
@ -83,7 +83,7 @@ describe('Models', () => {
}, },
} as any; } as any;
const opts = new RedocNormalizedOptions({downloadFileName: 'openapi.yaml'}); const opts = new RedocNormalizedOptions({ downloadFileName: 'openapi.yaml' });
const info = new ApiInfoModel(parser, opts); const info = new ApiInfoModel(parser, opts);
expect(info.downloadFileName).toEqual('openapi.yaml'); expect(info.downloadFileName).toEqual('openapi.yaml');
}); });
@ -96,7 +96,7 @@ describe('Models', () => {
}, },
} as any; } as any;
const opts = new RedocNormalizedOptions({downloadFileName: 'nope.txt'}); const opts = new RedocNormalizedOptions({ downloadFileName: 'nope.txt' });
const info = new ApiInfoModel(parser, opts); const info = new ApiInfoModel(parser, opts);
expect(info.downloadFileName).toEqual('swagger.json'); expect(info.downloadFileName).toEqual('swagger.json');
}); });

View File

@ -1,5 +1,5 @@
import * as path from 'path'; import * as path from 'path';
import * as yaml from 'js-yaml' import * as yaml from 'js-yaml';
import { OpenAPIContact, OpenAPIInfo, OpenAPILicense } from '../../types'; import { OpenAPIContact, OpenAPIInfo, OpenAPILicense } from '../../types';
import { IS_BROWSER } from '../../utils/'; import { IS_BROWSER } from '../../utils/';
import { OpenAPIParser } from '../OpenAPIParser'; import { OpenAPIParser } from '../OpenAPIParser';