Use `isDirected` instead of `instanceof Digraph`

This change ensures that our check for a directed graph works even when
g instanceof Digraph fails. It seems the failure can occur when pulling
in multiple versions of the graphlib library.
Prep v0.4.6 release