Skip to content

Commit 46ba4a1

Browse files
author
Max Schaefer
committed
JavaScript: Expose another useful predicate on API-graph nodes.
1 parent 86404af commit 46ba4a1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

javascript/ql/src/semmle/javascript/ApiGraphs.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ module API {
223223
) and
224224
length in [1 .. Impl::distanceFromRoot(this)]
225225
}
226+
227+
/** Gets the shortest distance from the root to this node in the API graph. */
228+
int getDepth() { result = Impl::distanceFromRoot(this) }
226229
}
227230

228231
/** The root node of an API graph. */

0 commit comments

Comments
 (0)