Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getSchemasRecursive(instance) {
const schemas = {};
Object.assign(schemas, instance.getSchemas());
const children = instance[symbols.kChildren];
if (children.length) {
children.forEach((child) => {
Object.assign(schemas, getSchemasRecursive(child));
});
}
return schemas;
}