import a from "../../../../../../lodash-es@4.17.22/node_modules/lodash-es/forEach.js";
import s from "../../../../../../lodash-es@4.17.22/node_modules/lodash-es/isArray.js";
function p(o, r, n) {
  s(r) || (r = [r]);
  var f = (o.isDirected() ? o.successors : o.neighbors).bind(o), i = [], t = {};
  return a(r, function(e) {
    if (!o.hasNode(e))
      throw new Error("Graph does not have node: " + e);
    h(o, e, n === "post", t, f, i);
  }), i;
}
function h(o, r, n, f, i, t) {
  Object.prototype.hasOwnProperty.call(f, r) || (f[r] = !0, n || t.push(r), a(i(r), function(e) {
    h(o, e, n, f, i, t);
  }), n && t.push(r));
}
export {
  p as dfs
};
