(versions)
| 49 | } |
| 50 | |
| 51 | export async function validateVersionsOptions(versions) { |
| 52 | const schemas = await getSchemas() |
| 53 | // Validate individual versions provided |
| 54 | versions.forEach((version) => { |
| 55 | if ( |
| 56 | schemas.deprecated.includes(`${version}.deref.json`) || |
| 57 | schemas.unpublished.includes(`${version}.deref.json`) |
| 58 | ) { |
| 59 | const errorMsg = `🛑 This script doesn't support generating individual deprecated or unpublished schemas. Please reach out to #docs-engineering if this is a use case that you need.` |
| 60 | throw new Error(errorMsg) |
| 61 | } else if (!schemas.currentReleases.includes(`${version}.deref.json`)) { |
| 62 | throw new Error(`🛑 The version (${version}) you specified is not valid.`) |
| 63 | } |
| 64 | }) |
| 65 | } |
no test coverage detected