add early example return for tree (#234)

This commit is contained in:
pascal-fischer
2024-09-22 19:12:31 +02:00
committed by GitHub
parent 4079455774
commit 1e9e6dc2d7

View File

@@ -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)];
}
}