Skip to content

Commit

Permalink
fix: add check that $ref value is a string (asyncapi#92)
Browse files Browse the repository at this point in the history
Co-authored-by: Maciej Urbańczyk <[email protected]>
  • Loading branch information
aeworxet and magicmatatjahu committed Oct 28, 2022
1 parent 67e5c61 commit 7a0fb39
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ function crawlChannelPropertiesForRefs(JSONSchema: AsyncAPIObject) {
* @returns {boolean}
* @private
*/
function isExternalReference(ref: string) {
return !ref.startsWith('#');
function isExternalReference(ref: string): boolean {
return typeof ref === 'string' && !ref.startsWith('#');
}

/**
Expand Down

0 comments on commit 7a0fb39

Please sign in to comment.