diff --git a/scripts/js/lib/api/generateApiComponents.ts b/scripts/js/lib/api/generateApiComponents.ts index 3355b2099ef..99bcc83511b 100644 --- a/scripts/js/lib/api/generateApiComponents.ts +++ b/scripts/js/lib/api/generateApiComponents.ts @@ -245,7 +245,7 @@ function prepareAttributeOrPropertyProps( }; const pageHeading = $dl.siblings("h1").text(); - if (id.endsWith(pageHeading) && pageHeading != "") { + if (pageHeading && id.endsWith(pageHeading)) { $dl.siblings("h1").text(getLastPartFromFullIdentifier(id)); return { ...props, @@ -279,7 +279,7 @@ function prepareFunctionProps( }; const pageHeading = $dl.siblings("h1").text(); - if (id.endsWith(pageHeading) && pageHeading != "") { + if (pageHeading && id.endsWith(pageHeading)) { // Page is already dedicated to apiType; no heading needed return { ...props,