(openApiVersion)
| 128 | // There is a mapping between the version names. This gets the Docs version from |
| 129 | // the OpenAPI version name (the filename ) |
| 130 | export function getDocsVersion(openApiVersion) { |
| 131 | const matchingVersion = Object.values(allVersions).find((version) => |
| 132 | openApiVersion.startsWith(version.openApiVersionName) |
| 133 | ) |
| 134 | |
| 135 | if (!matchingVersion) { |
| 136 | throw new Error(`Error: Could not find a matching version for ${openApiVersion}.`) |
| 137 | } |
| 138 | |
| 139 | return matchingVersion.version |
| 140 | } |
| 141 | |
| 142 | export { allVersions } |
no outgoing calls
no test coverage detected