Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (node.entries) {
res.concat(node.entries.map(function(subnode) {
subnode.parentElement = node;
_iterateDocTypes(subnode, cb);
}));
}
break;
case node instanceof TypeBuilder.RecordType.Entry:
// name: string,
// typeUnion: TypeUnion
node.typeUnion.collectionNode = node;
res = _iterateDocTypes(node.typeUnion, cb);
break;
case node instanceof TypeBuilder.ModuleName:
node.typeName = node.name;
node.module = true;
res = cb(node);
break;
default:
throw new Error('DocType: Unsupported doc node');
}
return res;
}