-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: migrating docs.yml to 0.15.0-rc0 should fail if custom-domain is…
… an array (#3467)
- Loading branch information
1 parent
f3d1b1a
commit 3a222a5
Showing
3 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...l-migrations/src/migrations/0.15.0-rc0/update-directory-structure/migrateDocsInstances.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { docsYml } from "@fern-api/configuration"; | ||
import { DocsURL } from "./docs-config"; | ||
|
||
export function migrateDocsInstances(docsURLs: docsYml.RawSchemas.DocsInstances[]): DocsURL[] { | ||
return docsURLs.map((docsURL) => { | ||
if (Array.isArray(docsURL.customDomain)) { | ||
throw new Error("Expected custom-domain to be a string, but it was an array."); | ||
} | ||
return { | ||
...docsURL, | ||
customDomain: docsURL.customDomain | ||
}; | ||
}); | ||
} |