Skip to content

Commit

Permalink
update stale comment
Browse files Browse the repository at this point in the history
  • Loading branch information
zchsh committed Nov 8, 2024
1 parent 4067e06 commit c4e6ebf
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,7 @@ export function parseOpenApiV2UrlContext(
const isVersionedUrl = /^\d{4}-\d{2}-\d{2}$/.test(pathParts[0])
const versionId = isVersionedUrl ? pathParts[0] : 'latest'

/**
* Note: operationSlug may be undefined. Ideally types would reflect this,
* but I've struggled to force TypeScript to recognize this.
*
* TODO: figure out how to cast operationSlug to `string | undefined`.
* Sounds simple but everything I've tried so far doesn't seem to work.
* (ie if i follow with `const test = operationSlug.length`, i should
* get a TypeScript error, but I don't!)
*/
// Note: operationSlug may be undefined, eg if we're on a landing page
const operationSlug = isVersionedUrl ? pathParts[1] : pathParts[0]

/**
Expand Down

0 comments on commit c4e6ebf

Please sign in to comment.