mirror of
https://github.com/netbirdio/docs.git
synced 2026-04-16 07:26:35 +00:00
add early example return for tree (#234)
This commit is contained in:
@@ -161,6 +161,9 @@ function extractInfo(obj, mode = 'example') {
|
||||
if (obj.items.hasOwnProperty('properties')) {
|
||||
return [extractInfo(obj.items.properties, mode)];
|
||||
} else {
|
||||
if (mode === 'example' && obj.hasOwnProperty('example')) {
|
||||
return obj.example;
|
||||
}
|
||||
return [extractInfo(obj.items, mode)];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user