mirror of
https://github.com/supabase/supabase.git
synced 2026-05-06 08:56:46 -04:00
cf3ecc93eb
strictNullChecks was off for docs, which lets errors slip through and leads to incorrect required/optional typing on Zod-inferred types. This PR enables strictNullChecks and fixes all the existing violations.
16 lines
428 B
TypeScript
16 lines
428 B
TypeScript
export function flattenSections(sections: any[]): any[] {
|
|
let a: any[] = []
|
|
for (let i = 0; i < sections.length; i++) {
|
|
if (sections[i].id) {
|
|
// only push a section that has an id
|
|
// these are reserved for sidebar subtitles
|
|
a.push(sections[i])
|
|
}
|
|
if (sections[i].items) {
|
|
// if there are subitems, loop through
|
|
a = a.concat(flattenSections(sections[i].items))
|
|
}
|
|
}
|
|
return a
|
|
}
|