mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
docs: hide literal union variants (#9347)
This commit is contained in:
1 parent
ab9ed4e41c
commit
c760942903
1 file changed
+8
-2
@@ -130,8 +130,14 @@ function recurseThroughParams(paramDefinition: TsDoc.TypeDefinition) {
|
||||
if (param.type?.declaration?.children) {
|
||||
children = param.type?.declaration?.children
|
||||
} else if (isUnion(param)) {
|
||||
// children = param.type.types
|
||||
children = null // We don't want to show the union types
|
||||
// We don't want to show the union types if it's a literal
|
||||
const nonLiteralVariants = param.type.types.filter(({ type }) => type !== 'literal')
|
||||
|
||||
if (nonLiteralVariants.length === 0) {
|
||||
children = null
|
||||
} else {
|
||||
children = nonLiteralVariants
|
||||
}
|
||||
} else if (param.type === 'reflection') {
|
||||
children = param.declaration.children
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user