File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -77,12 +77,6 @@ function createSampleTree(nodes: SampleTreeNode[]) {
77
77
}
78
78
79
79
if ( parent ) {
80
- if ( parent . rank >= node . rank ) {
81
- throw new Error (
82
- `Parent "${ parent . sample . sample } " has rank ${ parent . rank } >= ${ node . sample . sample } 's rank ${ node . rank } `
83
- ) ;
84
- }
85
-
86
80
node . parent = parent ;
87
81
parent . children . push ( node ) ;
88
82
}
@@ -105,6 +99,12 @@ function fixMissingRanks(sampleTree: SampleTreeNode) {
105
99
throw new Error ( "Rank must be defined for the root node." ) ;
106
100
}
107
101
node . rank = node . parent . rank + 1 ;
102
+ } else {
103
+ if ( node . parent && node . rank <= node . parent . rank ) {
104
+ throw new Error (
105
+ `Node "${ node . sample . sample } " has rank ${ node . rank } <= its parent's rank ${ node . parent . rank } `
106
+ ) ;
107
+ }
108
108
}
109
109
}
110
110
}
You can’t perform that action at this time.
0 commit comments