single object analysis refactor

This commit is contained in:
Jan Prochazka
2021-05-15 18:13:20 +02:00
parent 06a028a093
commit 032eaf9eb0
2 changed files with 9 additions and 6 deletions

View File

@@ -26,6 +26,14 @@ export class DatabaseAnalyser {
return this._runAnalysis();
}
async singleObjectAnalysis(name, typeField) {
this.singleObjectFilter = { ...name, typeField };
const res = this._runAnalysis();
if (res[typeField].length == 1) return res[typeField][0];
const obj = res[typeField].find(x => x.pureName == name.pureName && x.schemaName == name.schemaName);
return obj;
}
async incrementalAnalysis(structure) {
this.structure = structure;