From 58b549763c6e2364a04e6246459ba1efe721a693 Mon Sep 17 00:00:00 2001 From: Zachary Whaley Date: Tue, 20 Jul 2021 12:17:09 -0500 Subject: [PATCH] npm run prettier --- src/services/SpecStore.ts | 5 ++++- src/services/__tests__/models/ApiInfo.test.ts | 8 ++++---- src/services/models/ApiInfo.ts | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/services/SpecStore.ts b/src/services/SpecStore.ts index f6cdba07..20023ce0 100644 --- a/src/services/SpecStore.ts +++ b/src/services/SpecStore.ts @@ -28,7 +28,10 @@ export class SpecStore { this.externalDocs = this.parser.spec.externalDocs; this.contentItems = MenuBuilder.buildStructure(this.parser, this.options); this.securitySchemes = new SecuritySchemesModel(this.parser); - const webhookPath: Referenced = {...this.parser?.spec?.['x-webhooks'], ...this.parser?.spec.webhooks}; + const webhookPath: Referenced = { + ...this.parser?.spec?.['x-webhooks'], + ...this.parser?.spec.webhooks, + }; this.webhooks = new WebhookModel(this.parser, options, webhookPath); } } diff --git a/src/services/__tests__/models/ApiInfo.test.ts b/src/services/__tests__/models/ApiInfo.test.ts index c1f89685..b02527da 100644 --- a/src/services/__tests__/models/ApiInfo.test.ts +++ b/src/services/__tests__/models/ApiInfo.test.ts @@ -54,8 +54,8 @@ describe('Models', () => { license: { name: 'MIT', identifier: 'MIT', - url: 'https://opensource.org/licenses/MIT' - } + url: 'https://opensource.org/licenses/MIT', + }, }, } as any; @@ -83,7 +83,7 @@ describe('Models', () => { }, } as any; - const opts = new RedocNormalizedOptions({downloadFileName: 'openapi.yaml'}); + const opts = new RedocNormalizedOptions({ downloadFileName: 'openapi.yaml' }); const info = new ApiInfoModel(parser, opts); expect(info.downloadFileName).toEqual('openapi.yaml'); }); @@ -96,7 +96,7 @@ describe('Models', () => { }, } as any; - const opts = new RedocNormalizedOptions({downloadFileName: 'nope.txt'}); + const opts = new RedocNormalizedOptions({ downloadFileName: 'nope.txt' }); const info = new ApiInfoModel(parser, opts); expect(info.downloadFileName).toEqual('swagger.json'); }); diff --git a/src/services/models/ApiInfo.ts b/src/services/models/ApiInfo.ts index 8b56d1bb..c002a5fb 100644 --- a/src/services/models/ApiInfo.ts +++ b/src/services/models/ApiInfo.ts @@ -1,5 +1,5 @@ import * as path from 'path'; -import * as yaml from 'js-yaml' +import * as yaml from 'js-yaml'; import { OpenAPIContact, OpenAPIInfo, OpenAPILicense } from '../../types'; import { IS_BROWSER } from '../../utils/'; import { OpenAPIParser } from '../OpenAPIParser';