feat: adding check in normalizeDoc function to make sure readmeArr is of string type (#14481)

* feat: adding check in normalizeDoc function to make sure readmeArr is of string type

* fix: removing empty line

* Update scripts/docs-generation/3rdPartyDocs.ts

---------

Co-authored-by: Christian Bromann <git@bromann.dev>
This commit is contained in:
Kauan Barbosa 2025-05-14 23:06:28 -03:00 committed by GitHub
parent 7a4a6ce46a
commit 5c3868b46f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 2 deletions

View file

@ -1755,7 +1755,6 @@ export interface BrowserStackCapabilities {
*/
maskCommands?: string,
/**
* Enables the camera image injection feature.
*

View file

@ -127,7 +127,7 @@ function normalizeDoc(readme: string, githubUrl: string, branch: string, preface
*/
let sliceIdx = 0
for (let i = 0; i < readmeHeaderLines && sliceIdx === 0; i++) {
if (readmeHeaders.some(x => readmeArr[i].startsWith(x))) {
if (typeof readmeArr[i] === 'string' && readmeHeaders.some(x => readmeArr[i].startsWith(x))) {
sliceIdx = i + 1
}
}