$.udb(ds).isRecursive()
note
This article is about the isRecursive() function of the DataSourceContainer object.
$.udb(ds).isRecursive()
Detects whether the first data source in the container is a recursive data source, i.e. one that, directly or through one of its descendants, contains itself as a child data source.
Returns a boolean.
Syntax
$.udb( *ds* ).isRecursive()
The required ds is a data source selector.
Example
// avoid an unbounded traversal of a recursive data source's descendants
if ($.udb('EMPLOYEE').isRecursive()) {
console.log('EMPLOYEE contains itself as a descendant; traverse its children with care');
}
else {
$.udb('EMPLOYEE').children().forEach((child) => {
console.log('Child data source: %s', child.name());
});
}