From 42696a01ba8ef27523da40c07a5e61ba606e247f Mon Sep 17 00:00:00 2001 From: Chris Faulkner Date: Mon, 9 Dec 2019 22:13:37 -0800 Subject: [PATCH] doc: fix some typos (#1117) --- .github/CONTRIBUTING.md | 4 ++-- CHANGELOG.md | 22 +++++++++---------- benchmark/benchmark.js | 2 +- cli/Dockerfile | 2 +- config/docker/hooks/build | 2 +- demo/big-openapi.json | 22 +++++++++---------- demo/openapi.yaml | 8 +++---- demo/swagger.yaml | 2 +- src/components/Markdown/AdvancedMarkdown.tsx | 2 +- src/components/__tests__/JsonViewer.tsx | 6 ++--- src/services/MenuBuilder.ts | 2 +- src/services/MenuStore.ts | 2 +- src/services/OpenAPIParser.ts | 14 ++++++------ src/services/SpecStore.ts | 2 +- .../__tests__/history.service.test.ts | 2 +- .../__tests__/models/Response.test.ts | 2 +- src/utils/__tests__/openapi.test.ts | 8 +++---- src/utils/helpers.ts | 4 ++-- src/utils/highlight.ts | 2 +- src/utils/openapi.ts | 16 +++++++------- webpack.config.ts | 2 +- 21 files changed, 64 insertions(+), 64 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 09b04253..b5aa7b27 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -36,7 +36,7 @@ $ yarn install # or npm # dev-server, watch and auto reload playground $ yarn start -# start playground app in production environement +# start playground app in production environment $ yarn start:prod # runt tslint @@ -84,7 +84,7 @@ There are some other scripts available in the `scripts` section of the `package. - **`src`**: contains the source code. The codebase is written in Typescript. CSS styles are managed with [Styled components](https://www.styled-components.com/). State is managed by [MobX](https://github.com/mobxjs/mobx) - - **`src/common-elements`**: containts common Styled elements or components used in multiple places + - **`src/common-elements`**: contains common Styled elements or components used in multiple places - **`src/components`**: contains main visual components - **`src/services`**: contains different services used by ReDoc including MobX stores - **`src/services/models`**: contains classes for OpenAPI entities (e.g. Response, Operations, etc) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ff240a3..651dbf0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,7 +44,7 @@ * do not crash on empty scopes ([e787d9e](https://github.com/Redocly/redoc/commit/e787d9e)), closes [#1044](https://github.com/Redocly/redoc/issues/1044) * false-positive recursive detection with allOf at the same level ([faa74d6](https://github.com/Redocly/redoc/commit/faa74d6)) * fix scrollYOffset when SSR ([21258a5](https://github.com/Redocly/redoc/commit/21258a5)) -* left menu item before group is not highligted ([67e2a8f](https://github.com/Redocly/redoc/commit/67e2a8f)), closes [#1033](https://github.com/Redocly/redoc/issues/1033) +* left menu item before group is not highlighted ([67e2a8f](https://github.com/Redocly/redoc/commit/67e2a8f)), closes [#1033](https://github.com/Redocly/redoc/issues/1033) * remove excessive whitespace between md sections on small screens ([e318fb3](https://github.com/Redocly/redoc/commit/e318fb3)), closes [#874](https://github.com/Redocly/redoc/issues/874) * use url-template dependency ([#1008](https://github.com/Redocly/redoc/issues/1008)) ([32a464a](https://github.com/Redocly/redoc/commit/32a464a)), closes [#1007](https://github.com/Redocly/redoc/issues/1007) @@ -97,7 +97,7 @@ * do not add extra slashes to pattern ([70d1ee9](https://github.com/Redocly/redoc/commit/70d1ee9)), closes [#983](https://github.com/Redocly/redoc/issues/983) * dropdown fixes related to object description ([0504ad4](https://github.com/Redocly/redoc/commit/0504ad4)) -* incorrect serialization of parameter sample with hypen ([f7dd658](https://github.com/Redocly/redoc/commit/f7dd658)) +* incorrect serialization of parameter sample with hyphen ([f7dd658](https://github.com/Redocly/redoc/commit/f7dd658)) * redoc-cli: Add missing content type header on compressed responses of `/` path @@ -171,7 +171,7 @@ ### Bug Fixes -* broken schema talbes with long enums ([3a74b74](https://github.com/Rebilly/ReDoc/commit/3a74b74)) +* broken schema tables with long enums ([3a74b74](https://github.com/Rebilly/ReDoc/commit/3a74b74)) * deep linking sometimes not working when sent over messengers ([2491d97](https://github.com/Rebilly/ReDoc/commit/2491d97)) @@ -189,7 +189,7 @@ * IE11 add missing fetch and URL polyfills ([d2ce1bd](https://github.com/Rebilly/ReDoc/commit/d2ce1bd)), closes [#875](https://github.com/Rebilly/ReDoc/issues/875) * ignore empty x-tagGroups array ([#869](https://github.com/Rebilly/ReDoc/issues/869)) ([4366a0d](https://github.com/Rebilly/ReDoc/commit/4366a0d)) * incorrect detected schema title for deeply inherited schemas ([7d7b4e3](https://github.com/Rebilly/ReDoc/commit/7d7b4e3)) -* pluralize arrray of types ([fdcac30](https://github.com/Rebilly/ReDoc/commit/fdcac30)) +* pluralize array of types ([fdcac30](https://github.com/Rebilly/ReDoc/commit/fdcac30)) * remove huge space after Authentication section ([548fae3](https://github.com/Rebilly/ReDoc/commit/548fae3)), closes [#872](https://github.com/Rebilly/ReDoc/issues/872) * remove query string from server URL ([#895](https://github.com/Rebilly/ReDoc/issues/895)) ([64453ff](https://github.com/Rebilly/ReDoc/commit/64453ff)) * remove tabs top margin ([5c187f3](https://github.com/Rebilly/ReDoc/commit/5c187f3)) @@ -273,7 +273,7 @@ * improve scrolling performance in Chrome with non-wrapped json examples ([a69c402](https://github.com/Rebilly/ReDoc/commit/a69c402)) * nested oneOf button spacing ([3673720](https://github.com/Rebilly/ReDoc/commit/3673720)), closes [#719](https://github.com/Rebilly/ReDoc/issues/719) * onLoaded callback not run on spec error ([e77df0c](https://github.com/Rebilly/ReDoc/commit/e77df0c)), closes [#690](https://github.com/Rebilly/ReDoc/issues/690) -* theme improvments by [@stasiukanya](https://github.com/stasiukanya) ([e2d0cd5](https://github.com/Rebilly/ReDoc/commit/e2d0cd5)) +* theme improvements by [@stasiukanya](https://github.com/stasiukanya) ([e2d0cd5](https://github.com/Rebilly/ReDoc/commit/e2d0cd5)) * **cli:** old peer dependency issue with styled-components ([#699](https://github.com/Rebilly/ReDoc/issues/699)) ([9e2853c](https://github.com/Rebilly/ReDoc/commit/9e2853c)) @@ -345,7 +345,7 @@ ### Bug Fixes -* addd indent to array schema internals ([865f3ce](https://github.com/Rebilly/ReDoc/commit/865f3ce)) +* add indent to array schema internals ([865f3ce](https://github.com/Rebilly/ReDoc/commit/865f3ce)) * fix oneOf/anyOf titles ([39b930d](https://github.com/Rebilly/ReDoc/commit/39b930d)), closes [#618](https://github.com/Rebilly/ReDoc/issues/618) [#621](https://github.com/Rebilly/ReDoc/issues/621) @@ -391,7 +391,7 @@ ### Bug Fixes * add some spacing between operation description and parameters ([597688e](https://github.com/Rebilly/ReDoc/commit/597688e)) -* description is not rendered if doesn't containt markdown headings ([90ed717](https://github.com/Rebilly/ReDoc/commit/90ed717)), closes [#591](https://github.com/Rebilly/ReDoc/issues/591) +* description is not rendered if doesn't contain markdown headings ([90ed717](https://github.com/Rebilly/ReDoc/commit/90ed717)), closes [#591](https://github.com/Rebilly/ReDoc/issues/591) * download button downloads index.html instead of spec with CLI ([334f904](https://github.com/Rebilly/ReDoc/commit/334f904)), closes [#594](https://github.com/Rebilly/ReDoc/issues/594) * fix Authentication section is not rendered ([2ecc8bc](https://github.com/Rebilly/ReDoc/commit/2ecc8bc)), closes [#590](https://github.com/Rebilly/ReDoc/issues/590) * fix linebreaks in multiparagraph field descriptions ([8fb9cd6](https://github.com/Rebilly/ReDoc/commit/8fb9cd6)) @@ -702,7 +702,7 @@ ### Bug Fixes -* Path parameters are not correctly overriden ([c406dc5](https://github.com/Rebilly/ReDoc/commit/c406dc5)), closes [#400](https://github.com/Rebilly/ReDoc/issues/400) +* Path parameters are not correctly overridden ([c406dc5](https://github.com/Rebilly/ReDoc/commit/c406dc5)), closes [#400](https://github.com/Rebilly/ReDoc/issues/400) * Use parentNode instead of parentElement to fix IE11 crash ([e8adb60](https://github.com/Rebilly/ReDoc/commit/e8adb60)), closes [#406](https://github.com/Rebilly/ReDoc/issues/406) @@ -864,7 +864,7 @@ * do not ignore path level parameters ([14f8408](https://github.com/Rebilly/Redoc/commit/14f8408)) * improve rendering of types ([17da7b7](https://github.com/Rebilly/Redoc/commit/17da7b7)) * move title propagation to the correct place ([0b0bc99](https://github.com/Rebilly/Redoc/commit/0b0bc99)) -* owerwrite text-align to left ([bfee3ed](https://github.com/Rebilly/Redoc/commit/bfee3ed)) +* overwrite text-align to left ([bfee3ed](https://github.com/Rebilly/Redoc/commit/bfee3ed)) ### Features @@ -926,7 +926,7 @@ Complete rewrite also means that this rewrite may introduce issues, but they sho ### Deprecations -- Fonts are not loaded by ReDoc so you should load them. Default fonts can be loaded as bellow: +- Fonts are not loaded by ReDoc so you should load them. Default fonts can be loaded as below: ```html @@ -1295,7 +1295,7 @@ closes [#321](https://github.com/Rebilly/ReDoc/issues/321) ### Bug fixes * Update webpack to the latest beta ([#143](https://github.com/Rebilly/ReDoc/issues/143)) * Fix read-only fields appear in request samples ([#142](https://github.com/Rebilly/ReDoc/issues/142)) -* A few more minor UI improvemnts +* A few more minor UI improvements ### Features/Improvements * Major performance optimization with new option `lazy-rendering` diff --git a/benchmark/benchmark.js b/benchmark/benchmark.js index 0f100ee0..859c62b2 100644 --- a/benchmark/benchmark.js +++ b/benchmark/benchmark.js @@ -32,7 +32,7 @@ const configDir = './benchmark/revisions/config.js'; console.log(`Writing config "${configDir}"`); fs.writeFileSync(configDir, configFile); -console.log('Starging benchmark server'); +console.log('Starting benchmark server'); const proc = spawn('npm', ['run', 'start:benchmark']); proc.stdout.on('data', data => { diff --git a/cli/Dockerfile b/cli/Dockerfile index 2544f547..542d04e8 100644 --- a/cli/Dockerfile +++ b/cli/Dockerfile @@ -7,7 +7,7 @@ # To run: # To display the command line options: # $ docker run --rm -it redoc-cli --help -# .. will display the comand line help +# .. will display the command line help # # To turn `swagger.yml` file in the current directory, to html documentation 'redoc-static.html' # $ docker run --rm -it -v $PWD:/data redoc-cli bundle swagger.yml diff --git a/config/docker/hooks/build b/config/docker/hooks/build index 10203313..1de054f1 100755 --- a/config/docker/hooks/build +++ b/config/docker/hooks/build @@ -1,6 +1,6 @@ #!/bin/bash -# DockerHub cd into Dockerfile location before buil +# DockerHub cd into Dockerfile location before build # So we have to undo this. cd ../.. docker build -f config/docker/Dockerfile -t $IMAGE_NAME . diff --git a/demo/big-openapi.json b/demo/big-openapi.json index fa23ccfa..3152d142 100644 --- a/demo/big-openapi.json +++ b/demo/big-openapi.json @@ -53,7 +53,7 @@ }, { "name": "Contacts", - "description": "Contacts are Customer's address book.\nAll contact information used in Invoices, Subscriptions, Transacions, etc is enlisted here. Hovewer, changing a Contact won't change corresponding contact information in related resources\n" + "description": "Contacts are Customer's address book.\nAll contact information used in Invoices, Subscriptions, Transacions, etc is enlisted here. However, changing a Contact won't change corresponding contact information in related resources\n" }, { "name": "Coupons", @@ -93,7 +93,7 @@ }, { "name": "Files", - "description": "A File is an entity that can store a phyiscal file and some metadata. It also provides an easy access to\nits size, mime-type, user-defined tags and description thus allowing easy sorting and searching among stored\nfiles.\nThere are several methods of file uploading available: multipart/form-data encoded form, RAW POST (by sending\nfile contents as POST body), fetching from URL (by providing the file URL via 'url' param)\nAttachment is an entity that is used to link a File to one or multiple objects like Customer, Dispute, Payment,\nTransaction, Subscription, Plan, Product, Invoice, Note. That allows to quickly find and use files related to\nthose specific entities.\n" + "description": "A File is an entity that can store a physical file and some metadata. It also provides an easy access to\nits size, mime-type, user-defined tags and description thus allowing easy sorting and searching among stored\nfiles.\nThere are several methods of file uploading available: multipart/form-data encoded form, RAW POST (by sending\nfile contents as POST body), fetching from URL (by providing the file URL via 'url' param)\nAttachment is an entity that is used to link a File to one or multiple objects like Customer, Dispute, Payment,\nTransaction, Subscription, Plan, Product, Invoice, Note. That allows to quickly find and use files related to\nthose specific entities.\n" }, { "name": "Gateway Accounts", @@ -15623,7 +15623,7 @@ "description": "Reset user password\n", "responses": { "201": { - "description": "Password was reseted successfully", + "description": "Password was reset successfully", "headers": { "Rate-Limit-Limit": { "description": "The number of allowed requests in the current period", @@ -23851,17 +23851,17 @@ "type": "string" }, "totpRequired": { - "description": "The user setting of two-factor authentification", + "description": "The user setting of two-factor authentication", "readOnly": true, "type": "boolean" }, "totpSecret": { - "description": "The user TOTP key for authentification app (if TOTP enabled)", + "description": "The user TOTP key for authentication app (if TOTP enabled)", "readOnly": true, "type": "string" }, "totpUrl": { - "description": "The user link to QR-code for TOTP authentification app (if TOTP enabled)", + "description": "The user link to QR-code for TOTP authentication app (if TOTP enabled)", "readOnly": true, "type": "string", "format": "url" @@ -24250,7 +24250,7 @@ }, "bodyHtml": { "type": "string", - "description": "Leave empty to recieve \"text/plain\" email.\nThe template palceholders are allowed.\n" + "description": "Leave empty to receive \"text/plain\" email.\nThe template palceholders are allowed.\n" } }, "required": [ @@ -26495,15 +26495,15 @@ } }, "totpRequired": { - "description": "The user setting of two-factor authentification", + "description": "The user setting of two-factor authentication", "type": "boolean" }, "totpSecret": { - "description": "The user TOTP key for authentification app (if TOTP enabled)", + "description": "The user TOTP key for authentication app (if TOTP enabled)", "type": "string" }, "totpUrl": { - "description": "The user link to QR-code for TOTP authentification app (if TOTP enabled)", + "description": "The user link to QR-code for TOTP authentication app (if TOTP enabled)", "type": "string", "format": "url" }, @@ -26984,7 +26984,7 @@ "collectionExpand": { "name": "expand", "in": "query", - "description": "Expand response to get full related object intead of ID. See the expand guide for more info.", + "description": "Expand response to get full related object instead of ID. See the expand guide for more info.", "schema": { "type": "string" } diff --git a/demo/openapi.yaml b/demo/openapi.yaml index c34740ee..715ce2cb 100644 --- a/demo/openapi.yaml +++ b/demo/openapi.yaml @@ -306,7 +306,7 @@ paths: tags: - pet summary: Finds Pets by status - description: Multiple status values can be provided with comma seperated strings + description: Multiple status values can be provided with comma separated strings operationId: findPetsByStatus parameters: - name: status @@ -351,7 +351,7 @@ paths: - pet summary: Finds Pets by tags description: >- - Muliple tags can be provided with comma seperated strings. Use tag1, + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. operationId: findPetsByTags deprecated: true @@ -631,7 +631,7 @@ paths: type: integer format: int32 X-Expires-After: - description: date in UTC when toekn expires + description: date in UTC when token expires schema: type: string format: date-time @@ -777,7 +777,7 @@ components: type: boolean default: false readOnly: true - rqeuestId: + requestId: description: Unique Request Id type: string writeOnly: true diff --git a/demo/swagger.yaml b/demo/swagger.yaml index d00db441..9d629ad0 100644 --- a/demo/swagger.yaml +++ b/demo/swagger.yaml @@ -631,7 +631,7 @@ paths: X-Expires-After: type: string format: date-time - description: date in UTC when toekn expires + description: date in UTC when token expires '400': description: Invalid username/password supplied /user/logout: diff --git a/src/components/Markdown/AdvancedMarkdown.tsx b/src/components/Markdown/AdvancedMarkdown.tsx index d7714f5e..18bc3f33 100644 --- a/src/components/Markdown/AdvancedMarkdown.tsx +++ b/src/components/Markdown/AdvancedMarkdown.tsx @@ -25,7 +25,7 @@ export class AdvancedMarkdown extends React.Component { renderWithOptionsAndStore(options: RedocNormalizedOptions, store?: AppStore) { const { source, htmlWrap = i => i } = this.props; if (!store) { - throw new Error('When using componentes in markdown, store prop must be provided'); + throw new Error('When using components in markdown, store prop must be provided'); } const renderer = new MarkdownRenderer(options); diff --git a/src/components/__tests__/JsonViewer.tsx b/src/components/__tests__/JsonViewer.tsx index c9deb7da..8f8f745e 100644 --- a/src/components/__tests__/JsonViewer.tsx +++ b/src/components/__tests__/JsonViewer.tsx @@ -24,14 +24,14 @@ describe('Components', () => { }); test('should collapse/uncollapse', () => { - expect(component.html()).not.toContain('class="hoverable"'); // all are collapesed by default + expect(component.html()).not.toContain('class="hoverable"'); // all are collapsed by default const expandAll = component.find('div > span[children=" Expand all "]'); expandAll.simulate('click'); - expect(component.html()).toContain('class="hoverable"'); // all are collapesed + expect(component.html()).toContain('class="hoverable"'); // all are collapsed const collapseAll = component.find('div > span[children=" Collapse all "]'); collapseAll.simulate('click'); - expect(component.html()).not.toContain('class="hoverable"'); // all are collapesed + expect(component.html()).not.toContain('class="hoverable"'); // all are collapsed }); test('should collapse/uncollapse', () => { diff --git a/src/services/MenuBuilder.ts b/src/services/MenuBuilder.ts index 1987ba10..c5305d58 100644 --- a/src/services/MenuBuilder.ts +++ b/src/services/MenuBuilder.ts @@ -88,7 +88,7 @@ export class MenuBuilder { } /** - * Returns array of OperationsGroup items for the tag groups (x-tagGroups vendor extenstion) + * Returns array of OperationsGroup items for the tag groups (x-tagGroups vendor extension) * @param tags value of `x-tagGroups` vendor extension */ static getTagGroupsItems( diff --git a/src/services/MenuStore.ts b/src/services/MenuStore.ts index 0626196d..2a619af6 100644 --- a/src/services/MenuStore.ts +++ b/src/services/MenuStore.ts @@ -190,7 +190,7 @@ export class MenuStore { * activate menu item * @param item item to activate * @param updateLocation [true] whether to update location - * @param rewriteHistory [false] whether to rewrite browser history (do not create new enrty) + * @param rewriteHistory [false] whether to rewrite browser history (do not create new entry) */ @action activate( diff --git a/src/services/OpenAPIParser.ts b/src/services/OpenAPIParser.ts index a215b4f0..449b555e 100644 --- a/src/services/OpenAPIParser.ts +++ b/src/services/OpenAPIParser.ts @@ -112,7 +112,7 @@ export class OpenAPIParser { }; /** - * checks if the objectt is OpenAPI reference (containts $ref property) + * checks if the object is OpenAPI reference (contains $ref property) */ isRef(obj: any): obj is OpenAPIRef { if (!obj) { @@ -122,7 +122,7 @@ export class OpenAPIParser { } /** - * resets visited enpoints. should be run after + * resets visited endpoints. should be run after */ resetVisited() { if (process.env.NODE_ENV !== 'production') { @@ -146,7 +146,7 @@ export class OpenAPIParser { /** * Resolve given reference object or return as is if it is not a reference * @param obj object to dereference - * @param forceCircular whether to dereference even if it is cirular ref + * @param forceCircular whether to dereference even if it is circular ref */ deref(obj: OpenAPIRef | T, forceCircular: boolean = false): T { if (this.isRef(obj)) { @@ -177,10 +177,10 @@ export class OpenAPIParser { } /** - * Merge allOf contsraints. + * Merge allOf constraints. * @param schema schema with allOF * @param $ref pointer of the schema - * @param forceCircular whether to dereference children even if it is a cirular ref + * @param forceCircular whether to dereference children even if it is a circular ref */ mergeAllOf( schema: OpenAPISchema, @@ -275,13 +275,13 @@ export class OpenAPIParser { } // merge rest of constraints - // TODO: do more intelegent merge + // TODO: do more intelligent merge receiver = { ...subSchema, ...receiver }; if (subSchemaRef) { receiver.parentRefs!.push(subSchemaRef); if (receiver.title === undefined && isNamedDefinition(subSchemaRef)) { - // this is not so correct behaviour. comented out for now + // this is not so correct behaviour. commented out for now // ref: https://github.com/Redocly/redoc/issues/601 // receiver.title = JsonPointer.baseName(subSchemaRef); } diff --git a/src/services/SpecStore.ts b/src/services/SpecStore.ts index dcb39941..5a6c835d 100644 --- a/src/services/SpecStore.ts +++ b/src/services/SpecStore.ts @@ -6,7 +6,7 @@ import { SecuritySchemesModel } from './models/SecuritySchemes'; import { OpenAPIParser } from './OpenAPIParser'; import { RedocNormalizedOptions } from './RedocNormalizedOptions'; /** - * Store that containts all the specification related information in the form of tree + * Store that contains all the specification related information in the form of tree */ export class SpecStore { parser: OpenAPIParser; diff --git a/src/services/__tests__/history.service.test.ts b/src/services/__tests__/history.service.test.ts index 753340d0..e52664da 100644 --- a/src/services/__tests__/history.service.test.ts +++ b/src/services/__tests__/history.service.test.ts @@ -13,7 +13,7 @@ describe('History service', () => { expect(fn).toHaveBeenCalled(); }); - test('History subscribe should return unsubsribe function', () => { + test('History subscribe should return unsubscribe function', () => { const fn = jest.fn(); const unsubscribe = history.subscribe(fn); history.emit(); diff --git a/src/services/__tests__/models/Response.test.ts b/src/services/__tests__/models/Response.test.ts index bfd2f6f9..3fb220f2 100644 --- a/src/services/__tests__/models/Response.test.ts +++ b/src/services/__tests__/models/Response.test.ts @@ -22,7 +22,7 @@ describe('Models', () => { expect(resp.type).toEqual('error'); }); - test('default should be sucessful by default', () => { + test('default should be successful by default', () => { const resp = new ResponseModel(parser, 'default', false, {}, opts); expect(resp.type).toEqual('success'); }); diff --git a/src/utils/__tests__/openapi.test.ts b/src/utils/__tests__/openapi.test.ts index bcdfb193..465c6e6a 100644 --- a/src/utils/__tests__/openapi.test.ts +++ b/src/utils/__tests__/openapi.test.ts @@ -249,7 +249,7 @@ describe('Utils', () => { expect(res).toEqual([{ url: 'http://base.com/sandbox/test', description: '' }]); }); - it('should correcly resolve url with server relative path', () => { + it('should correctly resolve url with server relative path', () => { const res = normalizeServers('http://base.com/subpath/spec.yaml', [ { url: '/sandbox/test', @@ -258,7 +258,7 @@ describe('Utils', () => { expect(res).toEqual([{ url: 'http://base.com/sandbox/test', description: '' }]); }); - it('should correcly resolve url with relative path', () => { + it('should correctly resolve url with relative path', () => { const res = normalizeServers('http://base.com/subpath/spec.yaml', [ { url: 'sandbox/test', @@ -383,12 +383,12 @@ describe('Utils', () => { expect(pluralizeType('array')).toEqual('arrays'); }); - it('should pluralize complex dislay types', () => { + it('should pluralize complex display types', () => { expect(pluralizeType('object (Pet)')).toEqual('objects (Pet)'); expect(pluralizeType('string ')).toEqual('strings '); }); - it('should pluralize oneOf-ed dislay types', () => { + it('should pluralize oneOf-ed display types', () => { expect(pluralizeType('object or string')).toEqual('objects or strings'); expect(pluralizeType('object (Pet) or number ')).toEqual( 'objects (Pet) or numbers ', diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index b491340e..d2cbcfe7 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -2,7 +2,7 @@ import slugify from 'slugify'; import { format, parse } from 'url'; /** - * Maps over array passing `isLast` bool to iterator as the second arguemnt + * Maps over array passing `isLast` bool to iterator as the second argument */ export function mapWithLast(array: T[], iteratee: (item: T, isLast: boolean) => P) { const res: P[] = []; @@ -118,7 +118,7 @@ const isMergebleObject = (item): boolean => { /** * slugify() returns empty string when failed to slugify. - * so try to return minimun slugified-string with failed one which keeps original value + * so try to return minimum slugified-string with failed one which keeps original value * the regex codes are referenced with https://gist.github.com/mathewbyrne/1280286 */ export function safeSlugify(value: string): string { diff --git a/src/utils/highlight.ts b/src/utils/highlight.ts index da5d69b6..312bb2db 100644 --- a/src/utils/highlight.ts +++ b/src/utils/highlight.ts @@ -65,7 +65,7 @@ export function mapLang(lang: string): string { * Highlight source code string using Prism.js * @param source source code to highlight * @param lang highlight language - * @return highlighted souce code as **html string** + * @return highlighted source code as **html string** */ export function highlight(source: string, lang: string = DEFAULT_LANG): string { lang = lang.toLowerCase(); diff --git a/src/utils/openapi.ts b/src/utils/openapi.ts index e9657547..30b2bb20 100644 --- a/src/utils/openapi.ts +++ b/src/utils/openapi.ts @@ -137,13 +137,13 @@ export function isFormUrlEncoded(contentType: string): boolean { return contentType === 'application/x-www-form-urlencoded'; } -function delimitedEncodeField(fieldVal: any, fieldName: string, delimeter: string): string { +function delimitedEncodeField(fieldVal: any, fieldName: string, delimiter: string): string { if (Array.isArray(fieldVal)) { - return fieldVal.map(v => v.toString()).join(delimeter); + return fieldVal.map(v => v.toString()).join(delimiter); } else if (typeof fieldVal === 'object') { return Object.keys(fieldVal) - .map(k => `${k}${delimeter}${fieldVal[k]}`) - .join(delimeter); + .map(k => `${k}${delimiter}${fieldVal[k]}`) + .join(delimiter); } else { return fieldName + '=' + fieldVal.toString(); } @@ -165,7 +165,7 @@ function deepObjectEncodeField(fieldVal: any, fieldName: string): string { function serializeFormValue(name: string, explode: boolean, value: any) { // Use RFC6570 safe name ([a-zA-Z0-9_]) and replace with our name later - // e.g. URI.template doesn't parse names with hypen (-) which are valid query param names + // e.g. URI.template doesn't parse names with hyphen (-) which are valid query param names const safeName = '__redoc_param_name__'; const suffix = explode ? '*' : ''; const template = URLtemplate.parse(`{?${safeName}${suffix}}`); @@ -177,7 +177,7 @@ function serializeFormValue(name: string, explode: boolean, value: any) { /* * Should be used only for url-form-encoded body payloads - * To be used for parmaters should be extended with other style values + * To be used for parameters should be extended with other style values */ export function urlFormEncodePayload( payload: object, @@ -225,7 +225,7 @@ function serializePathParameter( } // Use RFC6570 safe name ([a-zA-Z0-9_]) and replace with our name later - // e.g. URI.template doesn't parse names with hypen (-) which are valid query param names + // e.g. URI.template doesn't parse names with hyphen (-) which are valid query param names const safeName = '__redoc_param_name__'; const template = URLtemplate.parse(`{${prefix}${safeName}${suffix}}`); @@ -478,7 +478,7 @@ export function mergeParams( operationParamNames[param.name + '_' + param.in] = true; }); - // filter out path params overriden by operation ones with the same name + // filter out path params overridden by operation ones with the same name pathParams = pathParams.filter(param => { param = parser.shalowDeref(param); return !operationParamNames[param.name + '_' + param.in]; diff --git a/webpack.config.ts b/webpack.config.ts index dda7c38a..e86137c0 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -5,7 +5,7 @@ import * as webpack from 'webpack'; import * as path from 'path'; const nodeExternals = require('webpack-node-externals')({ - // bundle in moudules that need transpiling + non-js (e.g. css) + // bundle in modules that need transpiling + non-js (e.g. css) whitelist: [ 'swagger2openapi', /reftools/,