{"version":3,"file":"graphology.cjs.js","sources":["../src/utils.js","../src/errors.js","../src/data.js","../src/attributes/nodes.js","../src/attributes/edges.js","../src/iteration/edges.js","../src/iteration/neighbors.js","../src/iteration/adjacency.js","../src/serialization.js","../src/graph.js","../src/classes.js","../src/endpoint.cjs.js"],"sourcesContent":["/**\n * Graphology Utilities\n * =====================\n *\n * Collection of helpful functions used by the implementation.\n */\n\n/**\n * Object.assign-like polyfill.\n *\n * @param {object} target - First object.\n * @param {object} [...objects] - Objects to merge.\n * @return {object}\n */\nfunction assignPolyfill() {\n const target = arguments[0];\n\n for (let i = 1, l = arguments.length; i < l; i++) {\n if (!arguments[i]) continue;\n\n for (const k in arguments[i]) target[k] = arguments[i][k];\n }\n\n return target;\n}\n\nlet assign = assignPolyfill;\n\nif (typeof Object.assign === 'function') assign = Object.assign;\n\nexport {assign};\n\n/**\n * Function returning the first matching edge for given path.\n * Note: this function does not check the existence of source & target. This\n * must be performed by the caller.\n *\n * @param {Graph} graph - Target graph.\n * @param {any} source - Source node.\n * @param {any} target - Target node.\n * @param {string} type - Type of the edge (mixed, directed or undirected).\n * @return {string|null}\n */\nexport function getMatchingEdge(graph, source, target, type) {\n const sourceData = graph._nodes.get(source);\n\n let edge = null;\n\n if (!sourceData) return edge;\n\n if (type === 'mixed') {\n edge =\n (sourceData.out && sourceData.out[target]) ||\n (sourceData.undirected && sourceData.undirected[target]);\n } else if (type === 'directed') {\n edge = sourceData.out && sourceData.out[target];\n } else {\n edge = sourceData.undirected && sourceData.undirected[target];\n }\n\n return edge;\n}\n\n/**\n * Checks whether the given value is a plain object.\n *\n * @param {mixed} value - Target value.\n * @return {boolean}\n */\nexport function isPlainObject(value) {\n // NOTE: as per https://github.com/graphology/graphology/issues/149\n // this function has been loosened not to reject object instances\n // coming from other JavaScript contexts. It has also been chosen\n // not to improve it to avoid obvious false positives and avoid\n // taking a performance hit. People should really use TypeScript\n // if they want to avoid feeding subtly irrelvant attribute objects.\n return typeof value === 'object' && value !== null;\n}\n\n/**\n * Checks whether the given object is empty.\n *\n * @param {object} o - Target Object.\n * @return {boolean}\n */\nexport function isEmpty(o) {\n let k;\n\n for (k in o) return false;\n\n return true;\n}\n\n/**\n * Creates a \"private\" property for the given member name by concealing it\n * using the `enumerable` option.\n *\n * @param {object} target - Target object.\n * @param {string} name - Member name.\n */\nexport function privateProperty(target, name, value) {\n Object.defineProperty(target, name, {\n enumerable: false,\n configurable: false,\n writable: true,\n value\n });\n}\n\n/**\n * Creates a read-only property for the given member name & the given getter.\n *\n * @param {object} target - Target object.\n * @param {string} name - Member name.\n * @param {mixed} value - The attached getter or fixed value.\n */\nexport function readOnlyProperty(target, name, value) {\n const descriptor = {\n enumerable: true,\n configurable: true\n };\n\n if (typeof value === 'function') {\n descriptor.get = value;\n } else {\n descriptor.value = value;\n descriptor.writable = false;\n }\n\n Object.defineProperty(target, name, descriptor);\n}\n\n/**\n * Returns whether the given object constitute valid hints.\n *\n * @param {object} hints - Target object.\n */\nexport function validateHints(hints) {\n if (!isPlainObject(hints)) return false;\n\n if (hints.attributes && !Array.isArray(hints.attributes)) return false;\n\n return true;\n}\n\n/**\n * Creates a function generating incremental ids for edges.\n *\n * @return {function}\n */\nexport function incrementalIdStartingFromRandomByte() {\n let i = Math.floor(Math.random() * 256) & 0xff;\n\n return () => {\n return i++;\n };\n}\n","/**\n * Graphology Custom Errors\n * =========================\n *\n * Defining custom errors for ease of use & easy unit tests across\n * implementations (normalized typology rather than relying on error\n * messages to check whether the correct error was found).\n */\nexport class GraphError extends Error {\n constructor(message) {\n super();\n this.name = 'GraphError';\n this.message = message;\n }\n}\n\nexport class InvalidArgumentsGraphError extends GraphError {\n constructor(message) {\n super(message);\n this.name = 'InvalidArgumentsGraphError';\n\n // This is V8 specific to enhance stack readability\n if (typeof Error.captureStackTrace === 'function')\n Error.captureStackTrace(\n this,\n InvalidArgumentsGraphError.prototype.constructor\n );\n }\n}\n\nexport class NotFoundGraphError extends GraphError {\n constructor(message) {\n super(message);\n this.name = 'NotFoundGraphError';\n\n // This is V8 specific to enhance stack readability\n if (typeof Error.captureStackTrace === 'function')\n Error.captureStackTrace(this, NotFoundGraphError.prototype.constructor);\n }\n}\n\nexport class UsageGraphError extends GraphError {\n constructor(message) {\n super(message);\n this.name = 'UsageGraphError';\n\n // This is V8 specific to enhance stack readability\n if (typeof Error.captureStackTrace === 'function')\n Error.captureStackTrace(this, UsageGraphError.prototype.constructor);\n }\n}\n","/**\n * Graphology Internal Data Classes\n * =================================\n *\n * Internal classes hopefully reduced to structs by engines & storing\n * necessary information for nodes & edges.\n *\n * Note that those classes don't rely on the `class` keyword to avoid some\n * cruft introduced by most of ES2015 transpilers.\n */\n\n/**\n * MixedNodeData class.\n *\n * @constructor\n * @param {string} string - The node's key.\n * @param {object} attributes - Node's attributes.\n */\nexport function MixedNodeData(key, attributes) {\n // Attributes\n this.key = key;\n this.attributes = attributes;\n\n this.clear();\n}\n\nMixedNodeData.prototype.clear = function () {\n // Degrees\n this.inDegree = 0;\n this.outDegree = 0;\n this.undirectedDegree = 0;\n this.undirectedLoops = 0;\n this.directedLoops = 0;\n\n // Indices\n this.in = {};\n this.out = {};\n this.undirected = {};\n};\n\n/**\n * DirectedNodeData class.\n *\n * @constructor\n * @param {string} string - The node's key.\n * @param {object} attributes - Node's attributes.\n */\nexport function DirectedNodeData(key, attributes) {\n // Attributes\n this.key = key;\n this.attributes = attributes;\n\n this.clear();\n}\n\nDirectedNodeData.prototype.clear = function () {\n // Degrees\n this.inDegree = 0;\n this.outDegree = 0;\n this.directedLoops = 0;\n\n // Indices\n this.in = {};\n this.out = {};\n};\n\n/**\n * UndirectedNodeData class.\n *\n * @constructor\n * @param {string} string - The node's key.\n * @param {object} attributes - Node's attributes.\n */\nexport function UndirectedNodeData(key, attributes) {\n // Attributes\n this.key = key;\n this.attributes = attributes;\n\n this.clear();\n}\n\nUndirectedNodeData.prototype.clear = function () {\n // Degrees\n this.undirectedDegree = 0;\n this.undirectedLoops = 0;\n\n // Indices\n this.undirected = {};\n};\n\n/**\n * EdgeData class.\n *\n * @constructor\n * @param {boolean} undirected - Whether the edge is undirected.\n * @param {string} string - The edge's key.\n * @param {string} source - Source of the edge.\n * @param {string} target - Target of the edge.\n * @param {object} attributes - Edge's attributes.\n */\nexport function EdgeData(undirected, key, source, target, attributes) {\n // Attributes\n this.key = key;\n this.attributes = attributes;\n this.undirected = undirected;\n\n // Extremities\n this.source = source;\n this.target = target;\n}\n\nEdgeData.prototype.attach = function () {\n let outKey = 'out';\n let inKey = 'in';\n\n if (this.undirected) outKey = inKey = 'undirected';\n\n const source = this.source.key;\n const target = this.target.key;\n\n // Handling source\n this.source[outKey][target] = this;\n\n if (this.undirected && source === target) return;\n\n // Handling target\n this.target[inKey][source] = this;\n};\n\nEdgeData.prototype.attachMulti = function () {\n let outKey = 'out';\n let inKey = 'in';\n\n const source = this.source.key;\n const target = this.target.key;\n\n if (this.undirected) outKey = inKey = 'undirected';\n\n // Handling source\n const adj = this.source[outKey];\n const head = adj[target];\n\n if (typeof head === 'undefined') {\n adj[target] = this;\n\n // Self-loop optimization\n if (!(this.undirected && source === target)) {\n // Handling target\n this.target[inKey][source] = this;\n }\n\n return;\n }\n\n // Prepending to doubly-linked list\n head.previous = this;\n this.next = head;\n\n // Pointing to new head\n // NOTE: use mutating swap later to avoid lookup?\n adj[target] = this;\n this.target[inKey][source] = this;\n};\n\nEdgeData.prototype.detach = function () {\n const source = this.source.key;\n const target = this.target.key;\n\n let outKey = 'out';\n let inKey = 'in';\n\n if (this.undirected) outKey = inKey = 'undirected';\n\n delete this.source[outKey][target];\n\n // No-op delete in case of undirected self-loop\n delete this.target[inKey][source];\n};\n\nEdgeData.prototype.detachMulti = function () {\n const source = this.source.key;\n const target = this.target.key;\n\n let outKey = 'out';\n let inKey = 'in';\n\n if (this.undirected) outKey = inKey = 'undirected';\n\n // Deleting from doubly-linked list\n if (this.previous === undefined) {\n // We are dealing with the head\n\n // Should we delete the adjacency entry because it is now empty?\n if (this.next === undefined) {\n delete this.source[outKey][target];\n\n // No-op delete in case of undirected self-loop\n delete this.target[inKey][source];\n } else {\n // Detaching\n this.next.previous = undefined;\n\n // NOTE: could avoid the lookups by creating a #.become mutating method\n this.source[outKey][target] = this.next;\n\n // No-op delete in case of undirected self-loop\n this.target[inKey][source] = this.next;\n }\n } else {\n // We are dealing with another list node\n this.previous.next = this.next;\n\n // If not last\n if (this.next !== undefined) {\n this.next.previous = this.previous;\n }\n }\n};\n","/**\n * Graphology Node Attributes methods\n * ===================================\n */\nimport {assign, isPlainObject} from '../utils';\n\nimport {InvalidArgumentsGraphError, NotFoundGraphError} from '../errors';\n\nconst NODE = 0;\nconst SOURCE = 1;\nconst TARGET = 2;\nconst OPPOSITE = 3;\n\nfunction findRelevantNodeData(\n graph,\n method,\n mode,\n nodeOrEdge,\n nameOrEdge,\n add1,\n add2\n) {\n let nodeData, edgeData, arg1, arg2;\n\n nodeOrEdge = '' + nodeOrEdge;\n\n if (mode === NODE) {\n nodeData = graph._nodes.get(nodeOrEdge);\n\n if (!nodeData)\n throw new NotFoundGraphError(\n `Graph.${method}: could not find the \"${nodeOrEdge}\" node in the graph.`\n );\n\n arg1 = nameOrEdge;\n arg2 = add1;\n } else if (mode === OPPOSITE) {\n nameOrEdge = '' + nameOrEdge;\n\n edgeData = graph._edges.get(nameOrEdge);\n\n if (!edgeData)\n throw new NotFoundGraphError(\n `Graph.${method}: could not find the \"${nameOrEdge}\" edge in the graph.`\n );\n\n const source = edgeData.source.key;\n const target = edgeData.target.key;\n\n if (nodeOrEdge === source) {\n nodeData = edgeData.target;\n } else if (nodeOrEdge === target) {\n nodeData = edgeData.source;\n } else {\n throw new NotFoundGraphError(\n `Graph.${method}: the \"${nodeOrEdge}\" node is not attached to the \"${nameOrEdge}\" edge (${source}, ${target}).`\n );\n }\n\n arg1 = add1;\n arg2 = add2;\n } else {\n edgeData = graph._edges.get(nodeOrEdge);\n\n if (!edgeData)\n throw new NotFoundGraphError(\n `Graph.${method}: could not find the \"${nodeOrEdge}\" edge in the graph.`\n );\n\n if (mode === SOURCE) {\n nodeData = edgeData.source;\n } else {\n nodeData = edgeData.target;\n }\n\n arg1 = nameOrEdge;\n arg2 = add1;\n }\n\n return [nodeData, arg1, arg2];\n}\n\nfunction attachNodeAttributeGetter(Class, method, mode) {\n Class.prototype[method] = function (nodeOrEdge, nameOrEdge, add1) {\n const [data, name] = findRelevantNodeData(\n this,\n method,\n mode,\n nodeOrEdge,\n nameOrEdge,\n add1\n );\n\n return data.attributes[name];\n };\n}\n\nfunction attachNodeAttributesGetter(Class, method, mode) {\n Class.prototype[method] = function (nodeOrEdge, nameOrEdge) {\n const [data] = findRelevantNodeData(\n this,\n method,\n mode,\n nodeOrEdge,\n nameOrEdge\n );\n\n return data.attributes;\n };\n}\n\nfunction attachNodeAttributeChecker(Class, method, mode) {\n Class.prototype[method] = function (nodeOrEdge, nameOrEdge, add1) {\n const [data, name] = findRelevantNodeData(\n this,\n method,\n mode,\n nodeOrEdge,\n nameOrEdge,\n add1\n );\n\n return data.attributes.hasOwnProperty(name);\n };\n}\n\nfunction attachNodeAttributeSetter(Class, method, mode) {\n Class.prototype[method] = function (nodeOrEdge, nameOrEdge, add1, add2) {\n const [data, name, value] = findRelevantNodeData(\n this,\n method,\n mode,\n nodeOrEdge,\n nameOrEdge,\n add1,\n add2\n );\n\n data.attributes[name] = value;\n\n // Emitting\n this.emit('nodeAttributesUpdated', {\n key: data.key,\n type: 'set',\n attributes: data.attributes,\n name\n });\n\n return this;\n };\n}\n\nfunction attachNodeAttributeUpdater(Class, method, mode) {\n Class.prototype[method] = function (nodeOrEdge, nameOrEdge, add1, add2) {\n const [data, name, updater] = findRelevantNodeData(\n this,\n method,\n mode,\n nodeOrEdge,\n nameOrEdge,\n add1,\n add2\n );\n\n if (typeof updater !== 'function')\n throw new InvalidArgumentsGraphError(\n `Graph.${method}: updater should be a function.`\n );\n\n const attributes = data.attributes;\n const value = updater(attributes[name]);\n\n attributes[name] = value;\n\n // Emitting\n this.emit('nodeAttributesUpdated', {\n key: data.key,\n type: 'set',\n attributes: data.attributes,\n name\n });\n\n return this;\n };\n}\n\nfunction attachNodeAttributeRemover(Class, method, mode) {\n Class.prototype[method] = function (nodeOrEdge, nameOrEdge, add1) {\n const [data, name] = findRelevantNodeData(\n this,\n method,\n mode,\n nodeOrEdge,\n nameOrEdge,\n add1\n );\n\n delete data.attributes[name];\n\n // Emitting\n this.emit('nodeAttributesUpdated', {\n key: data.key,\n type: 'remove',\n attributes: data.attributes,\n name\n });\n\n return this;\n };\n}\n\nfunction attachNodeAttributesReplacer(Class, method, mode) {\n Class.prototype[method] = function (nodeOrEdge, nameOrEdge, add1) {\n const [data, attributes] = findRelevantNodeData(\n this,\n method,\n mode,\n nodeOrEdge,\n nameOrEdge,\n add1\n );\n\n if (!isPlainObject(attributes))\n throw new InvalidArgumentsGraphError(\n `Graph.${method}: provided attributes are not a plain object.`\n );\n\n data.attributes = attributes;\n\n // Emitting\n this.emit('nodeAttributesUpdated', {\n key: data.key,\n type: 'replace',\n attributes: data.attributes\n });\n\n return this;\n };\n}\n\nfunction attachNodeAttributesMerger(Class, method, mode) {\n Class.prototype[method] = function (nodeOrEdge, nameOrEdge, add1) {\n const [data, attributes] = findRelevantNodeData(\n this,\n method,\n mode,\n nodeOrEdge,\n nameOrEdge,\n add1\n );\n\n if (!isPlainObject(attributes))\n throw new InvalidArgumentsGraphError(\n `Graph.${method}: provided attributes are not a plain object.`\n );\n\n assign(data.attributes, attributes);\n\n // Emitting\n this.emit('nodeAttributesUpdated', {\n key: data.key,\n type: 'merge',\n attributes: data.attributes,\n data: attributes\n });\n\n return this;\n };\n}\n\nfunction attachNodeAttributesUpdater(Class, method, mode) {\n Class.prototype[method] = function (nodeOrEdge, nameOrEdge, add1) {\n const [data, updater] = findRelevantNodeData(\n this,\n method,\n mode,\n nodeOrEdge,\n nameOrEdge,\n add1\n );\n\n if (typeof updater !== 'function')\n throw new InvalidArgumentsGraphError(\n `Graph.${method}: provided updater is not a function.`\n );\n\n data.attributes = updater(data.attributes);\n\n // Emitting\n this.emit('nodeAttributesUpdated', {\n key: data.key,\n type: 'update',\n attributes: data.attributes\n });\n\n return this;\n };\n}\n\n/**\n * List of methods to attach.\n */\nconst NODE_ATTRIBUTES_METHODS = [\n {\n name: element => `get${element}Attribute`,\n attacher: attachNodeAttributeGetter\n },\n {\n name: element => `get${element}Attributes`,\n attacher: attachNodeAttributesGetter\n },\n {\n name: element => `has${element}Attribute`,\n attacher: attachNodeAttributeChecker\n },\n {\n name: element => `set${element}Attribute`,\n attacher: attachNodeAttributeSetter\n },\n {\n name: element => `update${element}Attribute`,\n attacher: attachNodeAttributeUpdater\n },\n {\n name: element => `remove${element}Attribute`,\n attacher: attachNodeAttributeRemover\n },\n {\n name: element => `replace${element}Attributes`,\n attacher: attachNodeAttributesReplacer\n },\n {\n name: element => `merge${element}Attributes`,\n attacher: attachNodeAttributesMerger\n },\n {\n name: element => `update${element}Attributes`,\n attacher: attachNodeAttributesUpdater\n }\n];\n\n/**\n * Attach every attributes-related methods to a Graph class.\n *\n * @param {function} Graph - Target class.\n */\nexport default function attachNodeAttributesMethods(Graph) {\n NODE_ATTRIBUTES_METHODS.forEach(function ({name, attacher}) {\n // For nodes\n attacher(Graph, name('Node'), NODE);\n\n // For sources\n attacher(Graph, name('Source'), SOURCE);\n\n // For targets\n attacher(Graph, name('Target'), TARGET);\n\n // For opposites\n attacher(Graph, name('Opposite'), OPPOSITE);\n });\n}\n","/**\n * Graphology Edge Attributes methods\n * ===================================\n */\nimport {assign, isPlainObject, getMatchingEdge} from '../utils';\n\nimport {\n InvalidArgumentsGraphError,\n NotFoundGraphError,\n UsageGraphError\n} from '../errors';\n\n/**\n * Attach an attribute getter method onto the provided class.\n *\n * @param {function} Class - Target class.\n * @param {string} method - Method name.\n * @param {string} type - Type of the edge to find.\n */\nfunction attachEdgeAttributeGetter(Class, method, type) {\n /**\n * Get the desired attribute for the given element (node or edge).\n *\n * Arity 2:\n * @param {any} element - Target element.\n * @param {string} name - Attribute's name.\n *\n * Arity 3 (only for edges):\n * @param {any} source - Source element.\n * @param {any} target - Target element.\n * @param {string} name - Attribute's name.\n *\n * @return {mixed} - The attribute's value.\n *\n * @throws {Error} - Will throw if too many arguments are provided.\n * @throws {Error} - Will throw if any of the elements is not found.\n */\n Class.prototype[method] = function (element, name) {\n let data;\n\n if (this.type !== 'mixed' && type !== 'mixed' && type !== this.type)\n throw new UsageGraphError(\n `Graph.${method}: cannot find this type of edges in your ${this.type} graph.`\n );\n\n if (arguments.length > 2) {\n if (this.multi)\n throw new UsageGraphError(\n `Graph.${method}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`\n );\n\n const source = '' + element;\n const target = '' + name;\n\n name = arguments[2];\n\n data = getMatchingEdge(this, source, target, type);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.${method}: could not find an edge for the given path (\"${source}\" - \"${target}\").`\n );\n } else {\n if (type !== 'mixed')\n throw new UsageGraphError(\n `Graph.${method}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`\n );\n\n element = '' + element;\n data = this._edges.get(element);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.${method}: could not find the \"${element}\" edge in the graph.`\n );\n }\n\n return data.attributes[name];\n };\n}\n\n/**\n * Attach an attributes getter method onto the provided class.\n *\n * @param {function} Class - Target class.\n * @param {string} method - Method name.\n * @param {string} type - Type of the edge to find.\n */\nfunction attachEdgeAttributesGetter(Class, method, type) {\n /**\n * Retrieves all the target element's attributes.\n *\n * Arity 2:\n * @param {any} element - Target element.\n *\n * Arity 3 (only for edges):\n * @param {any} source - Source element.\n * @param {any} target - Target element.\n *\n * @return {object} - The element's attributes.\n *\n * @throws {Error} - Will throw if too many arguments are provided.\n * @throws {Error} - Will throw if any of the elements is not found.\n */\n Class.prototype[method] = function (element) {\n let data;\n\n if (this.type !== 'mixed' && type !== 'mixed' && type !== this.type)\n throw new UsageGraphError(\n `Graph.${method}: cannot find this type of edges in your ${this.type} graph.`\n );\n\n if (arguments.length > 1) {\n if (this.multi)\n throw new UsageGraphError(\n `Graph.${method}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`\n );\n\n const source = '' + element,\n target = '' + arguments[1];\n\n data = getMatchingEdge(this, source, target, type);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.${method}: could not find an edge for the given path (\"${source}\" - \"${target}\").`\n );\n } else {\n if (type !== 'mixed')\n throw new UsageGraphError(\n `Graph.${method}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`\n );\n\n element = '' + element;\n data = this._edges.get(element);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.${method}: could not find the \"${element}\" edge in the graph.`\n );\n }\n\n return data.attributes;\n };\n}\n\n/**\n * Attach an attribute checker method onto the provided class.\n *\n * @param {function} Class - Target class.\n * @param {string} method - Method name.\n * @param {string} type - Type of the edge to find.\n */\nfunction attachEdgeAttributeChecker(Class, method, type) {\n /**\n * Checks whether the desired attribute is set for the given element (node or edge).\n *\n * Arity 2:\n * @param {any} element - Target element.\n * @param {string} name - Attribute's name.\n *\n * Arity 3 (only for edges):\n * @param {any} source - Source element.\n * @param {any} target - Target element.\n * @param {string} name - Attribute's name.\n *\n * @return {boolean}\n *\n * @throws {Error} - Will throw if too many arguments are provided.\n * @throws {Error} - Will throw if any of the elements is not found.\n */\n Class.prototype[method] = function (element, name) {\n let data;\n\n if (this.type !== 'mixed' && type !== 'mixed' && type !== this.type)\n throw new UsageGraphError(\n `Graph.${method}: cannot find this type of edges in your ${this.type} graph.`\n );\n\n if (arguments.length > 2) {\n if (this.multi)\n throw new UsageGraphError(\n `Graph.${method}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`\n );\n\n const source = '' + element;\n const target = '' + name;\n\n name = arguments[2];\n\n data = getMatchingEdge(this, source, target, type);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.${method}: could not find an edge for the given path (\"${source}\" - \"${target}\").`\n );\n } else {\n if (type !== 'mixed')\n throw new UsageGraphError(\n `Graph.${method}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`\n );\n\n element = '' + element;\n data = this._edges.get(element);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.${method}: could not find the \"${element}\" edge in the graph.`\n );\n }\n\n return data.attributes.hasOwnProperty(name);\n };\n}\n\n/**\n * Attach an attribute setter method onto the provided class.\n *\n * @param {function} Class - Target class.\n * @param {string} method - Method name.\n * @param {string} type - Type of the edge to find.\n */\nfunction attachEdgeAttributeSetter(Class, method, type) {\n /**\n * Set the desired attribute for the given element (node or edge).\n *\n * Arity 2:\n * @param {any} element - Target element.\n * @param {string} name - Attribute's name.\n * @param {mixed} value - New attribute value.\n *\n * Arity 3 (only for edges):\n * @param {any} source - Source element.\n * @param {any} target - Target element.\n * @param {string} name - Attribute's name.\n * @param {mixed} value - New attribute value.\n *\n * @return {Graph} - Returns itself for chaining.\n *\n * @throws {Error} - Will throw if too many arguments are provided.\n * @throws {Error} - Will throw if any of the elements is not found.\n */\n Class.prototype[method] = function (element, name, value) {\n let data;\n\n if (this.type !== 'mixed' && type !== 'mixed' && type !== this.type)\n throw new UsageGraphError(\n `Graph.${method}: cannot find this type of edges in your ${this.type} graph.`\n );\n\n if (arguments.length > 3) {\n if (this.multi)\n throw new UsageGraphError(\n `Graph.${method}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`\n );\n\n const source = '' + element;\n const target = '' + name;\n\n name = arguments[2];\n value = arguments[3];\n\n data = getMatchingEdge(this, source, target, type);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.${method}: could not find an edge for the given path (\"${source}\" - \"${target}\").`\n );\n } else {\n if (type !== 'mixed')\n throw new UsageGraphError(\n `Graph.${method}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`\n );\n\n element = '' + element;\n data = this._edges.get(element);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.${method}: could not find the \"${element}\" edge in the graph.`\n );\n }\n\n data.attributes[name] = value;\n\n // Emitting\n this.emit('edgeAttributesUpdated', {\n key: data.key,\n type: 'set',\n attributes: data.attributes,\n name\n });\n\n return this;\n };\n}\n\n/**\n * Attach an attribute updater method onto the provided class.\n *\n * @param {function} Class - Target class.\n * @param {string} method - Method name.\n * @param {string} type - Type of the edge to find.\n */\nfunction attachEdgeAttributeUpdater(Class, method, type) {\n /**\n * Update the desired attribute for the given element (node or edge) using\n * the provided function.\n *\n * Arity 2:\n * @param {any} element - Target element.\n * @param {string} name - Attribute's name.\n * @param {function} updater - Updater function.\n *\n * Arity 3 (only for edges):\n * @param {any} source - Source element.\n * @param {any} target - Target element.\n * @param {string} name - Attribute's name.\n * @param {function} updater - Updater function.\n *\n * @return {Graph} - Returns itself for chaining.\n *\n * @throws {Error} - Will throw if too many arguments are provided.\n * @throws {Error} - Will throw if any of the elements is not found.\n */\n Class.prototype[method] = function (element, name, updater) {\n let data;\n\n if (this.type !== 'mixed' && type !== 'mixed' && type !== this.type)\n throw new UsageGraphError(\n `Graph.${method}: cannot find this type of edges in your ${this.type} graph.`\n );\n\n if (arguments.length > 3) {\n if (this.multi)\n throw new UsageGraphError(\n `Graph.${method}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`\n );\n\n const source = '' + element;\n const target = '' + name;\n\n name = arguments[2];\n updater = arguments[3];\n\n data = getMatchingEdge(this, source, target, type);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.${method}: could not find an edge for the given path (\"${source}\" - \"${target}\").`\n );\n } else {\n if (type !== 'mixed')\n throw new UsageGraphError(\n `Graph.${method}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`\n );\n\n element = '' + element;\n data = this._edges.get(element);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.${method}: could not find the \"${element}\" edge in the graph.`\n );\n }\n\n if (typeof updater !== 'function')\n throw new InvalidArgumentsGraphError(\n `Graph.${method}: updater should be a function.`\n );\n\n data.attributes[name] = updater(data.attributes[name]);\n\n // Emitting\n this.emit('edgeAttributesUpdated', {\n key: data.key,\n type: 'set',\n attributes: data.attributes,\n name\n });\n\n return this;\n };\n}\n\n/**\n * Attach an attribute remover method onto the provided class.\n *\n * @param {function} Class - Target class.\n * @param {string} method - Method name.\n * @param {string} type - Type of the edge to find.\n */\nfunction attachEdgeAttributeRemover(Class, method, type) {\n /**\n * Remove the desired attribute for the given element (node or edge).\n *\n * Arity 2:\n * @param {any} element - Target element.\n * @param {string} name - Attribute's name.\n *\n * Arity 3 (only for edges):\n * @param {any} source - Source element.\n * @param {any} target - Target element.\n * @param {string} name - Attribute's name.\n *\n * @return {Graph} - Returns itself for chaining.\n *\n * @throws {Error} - Will throw if too many arguments are provided.\n * @throws {Error} - Will throw if any of the elements is not found.\n */\n Class.prototype[method] = function (element, name) {\n let data;\n\n if (this.type !== 'mixed' && type !== 'mixed' && type !== this.type)\n throw new UsageGraphError(\n `Graph.${method}: cannot find this type of edges in your ${this.type} graph.`\n );\n\n if (arguments.length > 2) {\n if (this.multi)\n throw new UsageGraphError(\n `Graph.${method}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`\n );\n\n const source = '' + element;\n const target = '' + name;\n\n name = arguments[2];\n\n data = getMatchingEdge(this, source, target, type);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.${method}: could not find an edge for the given path (\"${source}\" - \"${target}\").`\n );\n } else {\n if (type !== 'mixed')\n throw new UsageGraphError(\n `Graph.${method}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`\n );\n\n element = '' + element;\n data = this._edges.get(element);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.${method}: could not find the \"${element}\" edge in the graph.`\n );\n }\n\n delete data.attributes[name];\n\n // Emitting\n this.emit('edgeAttributesUpdated', {\n key: data.key,\n type: 'remove',\n attributes: data.attributes,\n name\n });\n\n return this;\n };\n}\n\n/**\n * Attach an attribute replacer method onto the provided class.\n *\n * @param {function} Class - Target class.\n * @param {string} method - Method name.\n * @param {string} type - Type of the edge to find.\n */\nfunction attachEdgeAttributesReplacer(Class, method, type) {\n /**\n * Replace the attributes for the given element (node or edge).\n *\n * Arity 2:\n * @param {any} element - Target element.\n * @param {object} attributes - New attributes.\n *\n * Arity 3 (only for edges):\n * @param {any} source - Source element.\n * @param {any} target - Target element.\n * @param {object} attributes - New attributes.\n *\n * @return {Graph} - Returns itself for chaining.\n *\n * @throws {Error} - Will throw if too many arguments are provided.\n * @throws {Error} - Will throw if any of the elements is not found.\n */\n Class.prototype[method] = function (element, attributes) {\n let data;\n\n if (this.type !== 'mixed' && type !== 'mixed' && type !== this.type)\n throw new UsageGraphError(\n `Graph.${method}: cannot find this type of edges in your ${this.type} graph.`\n );\n\n if (arguments.length > 2) {\n if (this.multi)\n throw new UsageGraphError(\n `Graph.${method}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`\n );\n\n const source = '' + element,\n target = '' + attributes;\n\n attributes = arguments[2];\n\n data = getMatchingEdge(this, source, target, type);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.${method}: could not find an edge for the given path (\"${source}\" - \"${target}\").`\n );\n } else {\n if (type !== 'mixed')\n throw new UsageGraphError(\n `Graph.${method}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`\n );\n\n element = '' + element;\n data = this._edges.get(element);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.${method}: could not find the \"${element}\" edge in the graph.`\n );\n }\n\n if (!isPlainObject(attributes))\n throw new InvalidArgumentsGraphError(\n `Graph.${method}: provided attributes are not a plain object.`\n );\n\n data.attributes = attributes;\n\n // Emitting\n this.emit('edgeAttributesUpdated', {\n key: data.key,\n type: 'replace',\n attributes: data.attributes\n });\n\n return this;\n };\n}\n\n/**\n * Attach an attribute merger method onto the provided class.\n *\n * @param {function} Class - Target class.\n * @param {string} method - Method name.\n * @param {string} type - Type of the edge to find.\n */\nfunction attachEdgeAttributesMerger(Class, method, type) {\n /**\n * Merge the attributes for the given element (node or edge).\n *\n * Arity 2:\n * @param {any} element - Target element.\n * @param {object} attributes - Attributes to merge.\n *\n * Arity 3 (only for edges):\n * @param {any} source - Source element.\n * @param {any} target - Target element.\n * @param {object} attributes - Attributes to merge.\n *\n * @return {Graph} - Returns itself for chaining.\n *\n * @throws {Error} - Will throw if too many arguments are provided.\n * @throws {Error} - Will throw if any of the elements is not found.\n */\n Class.prototype[method] = function (element, attributes) {\n let data;\n\n if (this.type !== 'mixed' && type !== 'mixed' && type !== this.type)\n throw new UsageGraphError(\n `Graph.${method}: cannot find this type of edges in your ${this.type} graph.`\n );\n\n if (arguments.length > 2) {\n if (this.multi)\n throw new UsageGraphError(\n `Graph.${method}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`\n );\n\n const source = '' + element,\n target = '' + attributes;\n\n attributes = arguments[2];\n\n data = getMatchingEdge(this, source, target, type);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.${method}: could not find an edge for the given path (\"${source}\" - \"${target}\").`\n );\n } else {\n if (type !== 'mixed')\n throw new UsageGraphError(\n `Graph.${method}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`\n );\n\n element = '' + element;\n data = this._edges.get(element);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.${method}: could not find the \"${element}\" edge in the graph.`\n );\n }\n\n if (!isPlainObject(attributes))\n throw new InvalidArgumentsGraphError(\n `Graph.${method}: provided attributes are not a plain object.`\n );\n\n assign(data.attributes, attributes);\n\n // Emitting\n this.emit('edgeAttributesUpdated', {\n key: data.key,\n type: 'merge',\n attributes: data.attributes,\n data: attributes\n });\n\n return this;\n };\n}\n\n/**\n * Attach an attribute updater method onto the provided class.\n *\n * @param {function} Class - Target class.\n * @param {string} method - Method name.\n * @param {string} type - Type of the edge to find.\n */\nfunction attachEdgeAttributesUpdater(Class, method, type) {\n /**\n * Update the attributes of the given element (node or edge).\n *\n * Arity 2:\n * @param {any} element - Target element.\n * @param {function} updater - Updater function.\n *\n * Arity 3 (only for edges):\n * @param {any} source - Source element.\n * @param {any} target - Target element.\n * @param {function} updater - Updater function.\n *\n * @return {Graph} - Returns itself for chaining.\n *\n * @throws {Error} - Will throw if too many arguments are provided.\n * @throws {Error} - Will throw if any of the elements is not found.\n */\n Class.prototype[method] = function (element, updater) {\n let data;\n\n if (this.type !== 'mixed' && type !== 'mixed' && type !== this.type)\n throw new UsageGraphError(\n `Graph.${method}: cannot find this type of edges in your ${this.type} graph.`\n );\n\n if (arguments.length > 2) {\n if (this.multi)\n throw new UsageGraphError(\n `Graph.${method}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`\n );\n\n const source = '' + element,\n target = '' + updater;\n\n updater = arguments[2];\n\n data = getMatchingEdge(this, source, target, type);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.${method}: could not find an edge for the given path (\"${source}\" - \"${target}\").`\n );\n } else {\n if (type !== 'mixed')\n throw new UsageGraphError(\n `Graph.${method}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`\n );\n\n element = '' + element;\n data = this._edges.get(element);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.${method}: could not find the \"${element}\" edge in the graph.`\n );\n }\n\n if (typeof updater !== 'function')\n throw new InvalidArgumentsGraphError(\n `Graph.${method}: provided updater is not a function.`\n );\n\n data.attributes = updater(data.attributes);\n\n // Emitting\n this.emit('edgeAttributesUpdated', {\n key: data.key,\n type: 'update',\n attributes: data.attributes\n });\n\n return this;\n };\n}\n\n/**\n * List of methods to attach.\n */\nconst EDGE_ATTRIBUTES_METHODS = [\n {\n name: element => `get${element}Attribute`,\n attacher: attachEdgeAttributeGetter\n },\n {\n name: element => `get${element}Attributes`,\n attacher: attachEdgeAttributesGetter\n },\n {\n name: element => `has${element}Attribute`,\n attacher: attachEdgeAttributeChecker\n },\n {\n name: element => `set${element}Attribute`,\n attacher: attachEdgeAttributeSetter\n },\n {\n name: element => `update${element}Attribute`,\n attacher: attachEdgeAttributeUpdater\n },\n {\n name: element => `remove${element}Attribute`,\n attacher: attachEdgeAttributeRemover\n },\n {\n name: element => `replace${element}Attributes`,\n attacher: attachEdgeAttributesReplacer\n },\n {\n name: element => `merge${element}Attributes`,\n attacher: attachEdgeAttributesMerger\n },\n {\n name: element => `update${element}Attributes`,\n attacher: attachEdgeAttributesUpdater\n }\n];\n\n/**\n * Attach every attributes-related methods to a Graph class.\n *\n * @param {function} Graph - Target class.\n */\nexport default function attachEdgeAttributesMethods(Graph) {\n EDGE_ATTRIBUTES_METHODS.forEach(function ({name, attacher}) {\n // For edges\n attacher(Graph, name('Edge'), 'mixed');\n\n // For directed edges\n attacher(Graph, name('DirectedEdge'), 'directed');\n\n // For undirected edges\n attacher(Graph, name('UndirectedEdge'), 'undirected');\n });\n}\n","/**\n * Graphology Edge Iteration\n * ==========================\n *\n * Attaching some methods to the Graph class to be able to iterate over a\n * graph's edges.\n */\nimport Iterator from 'obliterator/iterator';\nimport chain from 'obliterator/chain';\nimport take from 'obliterator/take';\n\nimport {InvalidArgumentsGraphError, NotFoundGraphError} from '../errors';\n\n/**\n * Definitions.\n */\nconst EDGES_ITERATION = [\n {\n name: 'edges',\n type: 'mixed'\n },\n {\n name: 'inEdges',\n type: 'directed',\n direction: 'in'\n },\n {\n name: 'outEdges',\n type: 'directed',\n direction: 'out'\n },\n {\n name: 'inboundEdges',\n type: 'mixed',\n direction: 'in'\n },\n {\n name: 'outboundEdges',\n type: 'mixed',\n direction: 'out'\n },\n {\n name: 'directedEdges',\n type: 'directed'\n },\n {\n name: 'undirectedEdges',\n type: 'undirected'\n }\n];\n\n/**\n * Function iterating over edges from the given object to match one of them.\n *\n * @param {object} object - Target object.\n * @param {function} callback - Function to call.\n */\nfunction forEachSimple(breakable, object, callback, avoid) {\n let shouldBreak = false;\n\n for (const k in object) {\n if (k === avoid) continue;\n\n const edgeData = object[k];\n\n shouldBreak = callback(\n edgeData.key,\n edgeData.attributes,\n edgeData.source.key,\n edgeData.target.key,\n edgeData.source.attributes,\n edgeData.target.attributes,\n edgeData.undirected\n );\n\n if (breakable && shouldBreak) return edgeData.key;\n }\n\n return;\n}\n\nfunction forEachMulti(breakable, object, callback, avoid) {\n let edgeData, source, target;\n\n let shouldBreak = false;\n\n for (const k in object) {\n if (k === avoid) continue;\n\n edgeData = object[k];\n\n do {\n source = edgeData.source;\n target = edgeData.target;\n\n shouldBreak = callback(\n edgeData.key,\n edgeData.attributes,\n source.key,\n target.key,\n source.attributes,\n target.attributes,\n edgeData.undirected\n );\n\n if (breakable && shouldBreak) return edgeData.key;\n\n edgeData = edgeData.next;\n } while (edgeData !== undefined);\n }\n\n return;\n}\n\n/**\n * Function returning an iterator over edges from the given object.\n *\n * @param {object} object - Target object.\n * @return {Iterator}\n */\nfunction createIterator(object, avoid) {\n const keys = Object.keys(object);\n const l = keys.length;\n\n let edgeData;\n let i = 0;\n\n return new Iterator(function next() {\n do {\n if (!edgeData) {\n if (i >= l) return {done: true};\n\n const k = keys[i++];\n\n if (k === avoid) {\n edgeData = undefined;\n continue;\n }\n\n edgeData = object[k];\n } else {\n edgeData = edgeData.next;\n }\n } while (!edgeData);\n\n return {\n done: false,\n value: {\n edge: edgeData.key,\n attributes: edgeData.attributes,\n source: edgeData.source.key,\n target: edgeData.target.key,\n sourceAttributes: edgeData.source.attributes,\n targetAttributes: edgeData.target.attributes,\n undirected: edgeData.undirected\n }\n };\n });\n}\n\n/**\n * Function iterating over the egdes from the object at given key to match\n * one of them.\n *\n * @param {object} object - Target object.\n * @param {mixed} k - Neighbor key.\n * @param {function} callback - Callback to use.\n */\nfunction forEachForKeySimple(breakable, object, k, callback) {\n const edgeData = object[k];\n\n if (!edgeData) return;\n\n const sourceData = edgeData.source;\n const targetData = edgeData.target;\n\n if (\n callback(\n edgeData.key,\n edgeData.attributes,\n sourceData.key,\n targetData.key,\n sourceData.attributes,\n targetData.attributes,\n edgeData.undirected\n ) &&\n breakable\n )\n return edgeData.key;\n}\n\nfunction forEachForKeyMulti(breakable, object, k, callback) {\n let edgeData = object[k];\n\n if (!edgeData) return;\n\n let shouldBreak = false;\n\n do {\n shouldBreak = callback(\n edgeData.key,\n edgeData.attributes,\n edgeData.source.key,\n edgeData.target.key,\n edgeData.source.attributes,\n edgeData.target.attributes,\n edgeData.undirected\n );\n\n if (breakable && shouldBreak) return edgeData.key;\n\n edgeData = edgeData.next;\n } while (edgeData !== undefined);\n\n return;\n}\n\n/**\n * Function returning an iterator over the egdes from the object at given key.\n *\n * @param {object} object - Target object.\n * @param {mixed} k - Neighbor key.\n * @return {Iterator}\n */\nfunction createIteratorForKey(object, k) {\n let edgeData = object[k];\n\n if (edgeData.next !== undefined) {\n return new Iterator(function () {\n if (!edgeData) return {done: true};\n\n const value = {\n edge: edgeData.key,\n attributes: edgeData.attributes,\n source: edgeData.source.key,\n target: edgeData.target.key,\n sourceAttributes: edgeData.source.attributes,\n targetAttributes: edgeData.target.attributes,\n undirected: edgeData.undirected\n };\n\n edgeData = edgeData.next;\n\n return {\n done: false,\n value\n };\n });\n }\n\n return Iterator.of({\n edge: edgeData.key,\n attributes: edgeData.attributes,\n source: edgeData.source.key,\n target: edgeData.target.key,\n sourceAttributes: edgeData.source.attributes,\n targetAttributes: edgeData.target.attributes,\n undirected: edgeData.undirected\n });\n}\n\n/**\n * Function creating an array of edges for the given type.\n *\n * @param {Graph} graph - Target Graph instance.\n * @param {string} type - Type of edges to retrieve.\n * @return {array} - Array of edges.\n */\nfunction createEdgeArray(graph, type) {\n if (graph.size === 0) return [];\n\n if (type === 'mixed' || type === graph.type) {\n if (typeof Array.from === 'function')\n return Array.from(graph._edges.keys());\n\n return take(graph._edges.keys(), graph._edges.size);\n }\n\n const size =\n type === 'undirected' ? graph.undirectedSize : graph.directedSize;\n\n const list = new Array(size),\n mask = type === 'undirected';\n\n const iterator = graph._edges.values();\n\n let i = 0;\n let step, data;\n\n while (((step = iterator.next()), step.done !== true)) {\n data = step.value;\n\n if (data.undirected === mask) list[i++] = data.key;\n }\n\n return list;\n}\n\n/**\n * Function iterating over a graph's edges using a callback to match one of\n * them.\n *\n * @param {Graph} graph - Target Graph instance.\n * @param {string} type - Type of edges to retrieve.\n * @param {function} callback - Function to call.\n */\nfunction forEachEdge(breakable, graph, type, callback) {\n if (graph.size === 0) return;\n\n const shouldFilter = type !== 'mixed' && type !== graph.type;\n const mask = type === 'undirected';\n\n let step, data;\n let shouldBreak = false;\n const iterator = graph._edges.values();\n\n while (((step = iterator.next()), step.done !== true)) {\n data = step.value;\n\n if (shouldFilter && data.undirected !== mask) continue;\n\n const {key, attributes, source, target} = data;\n\n shouldBreak = callback(\n key,\n attributes,\n source.key,\n target.key,\n source.attributes,\n target.attributes,\n data.undirected\n );\n\n if (breakable && shouldBreak) return key;\n }\n\n return;\n}\n\n/**\n * Function creating an iterator of edges for the given type.\n *\n * @param {Graph} graph - Target Graph instance.\n * @param {string} type - Type of edges to retrieve.\n * @return {Iterator}\n */\nfunction createEdgeIterator(graph, type) {\n if (graph.size === 0) return Iterator.empty();\n\n const shouldFilter = type !== 'mixed' && type !== graph.type;\n const mask = type === 'undirected';\n\n const iterator = graph._edges.values();\n\n return new Iterator(function next() {\n let step, data;\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n step = iterator.next();\n\n if (step.done) return step;\n\n data = step.value;\n\n if (shouldFilter && data.undirected !== mask) continue;\n\n break;\n }\n\n const value = {\n edge: data.key,\n attributes: data.attributes,\n source: data.source.key,\n target: data.target.key,\n sourceAttributes: data.source.attributes,\n targetAttributes: data.target.attributes,\n undirected: data.undirected\n };\n\n return {value, done: false};\n });\n}\n\n/**\n * Function iterating over a node's edges using a callback to match one of them.\n *\n * @param {boolean} multi - Whether the graph is multi or not.\n * @param {string} type - Type of edges to retrieve.\n * @param {string} direction - In or out?\n * @param {any} nodeData - Target node's data.\n * @param {function} callback - Function to call.\n */\nfunction forEachEdgeForNode(\n breakable,\n multi,\n type,\n direction,\n nodeData,\n callback\n) {\n const fn = multi ? forEachMulti : forEachSimple;\n\n let found;\n\n if (type !== 'undirected') {\n if (direction !== 'out') {\n found = fn(breakable, nodeData.in, callback);\n\n if (breakable && found) return found;\n }\n if (direction !== 'in') {\n found = fn(\n breakable,\n nodeData.out,\n callback,\n !direction ? nodeData.key : undefined\n );\n\n if (breakable && found) return found;\n }\n }\n\n if (type !== 'directed') {\n found = fn(breakable, nodeData.undirected, callback);\n\n if (breakable && found) return found;\n }\n\n return;\n}\n\n/**\n * Function creating an array of edges for the given type & the given node.\n *\n * @param {boolean} multi - Whether the graph is multi or not.\n * @param {string} type - Type of edges to retrieve.\n * @param {string} direction - In or out?\n * @param {any} nodeData - Target node's data.\n * @return {array} - Array of edges.\n */\nfunction createEdgeArrayForNode(multi, type, direction, nodeData) {\n const edges = []; // TODO: possibility to know size beforehand or factorize with map\n\n forEachEdgeForNode(false, multi, type, direction, nodeData, function (key) {\n edges.push(key);\n });\n\n return edges;\n}\n\n/**\n * Function iterating over a node's edges using a callback.\n *\n * @param {string} type - Type of edges to retrieve.\n * @param {string} direction - In or out?\n * @param {any} nodeData - Target node's data.\n * @return {Iterator}\n */\nfunction createEdgeIteratorForNode(type, direction, nodeData) {\n let iterator = Iterator.empty();\n\n if (type !== 'undirected') {\n if (direction !== 'out' && typeof nodeData.in !== 'undefined')\n iterator = chain(iterator, createIterator(nodeData.in));\n if (direction !== 'in' && typeof nodeData.out !== 'undefined')\n iterator = chain(\n iterator,\n createIterator(nodeData.out, !direction ? nodeData.key : undefined)\n );\n }\n\n if (type !== 'directed' && typeof nodeData.undirected !== 'undefined') {\n iterator = chain(iterator, createIterator(nodeData.undirected));\n }\n\n return iterator;\n}\n\n/**\n * Function iterating over edges for the given path using a callback to match\n * one of them.\n *\n * @param {string} type - Type of edges to retrieve.\n * @param {boolean} multi - Whether the graph is multi.\n * @param {string} direction - In or out?\n * @param {NodeData} sourceData - Source node's data.\n * @param {string} target - Target node.\n * @param {function} callback - Function to call.\n */\nfunction forEachEdgeForPath(\n breakable,\n type,\n multi,\n direction,\n sourceData,\n target,\n callback\n) {\n const fn = multi ? forEachForKeyMulti : forEachForKeySimple;\n\n let found;\n\n if (type !== 'undirected') {\n if (typeof sourceData.in !== 'undefined' && direction !== 'out') {\n found = fn(breakable, sourceData.in, target, callback);\n\n if (breakable && found) return found;\n }\n\n if (\n typeof sourceData.out !== 'undefined' &&\n direction !== 'in' &&\n (direction || sourceData.key !== target)\n ) {\n found = fn(breakable, sourceData.out, target, callback);\n\n if (breakable && found) return found;\n }\n }\n\n if (type !== 'directed') {\n if (typeof sourceData.undirected !== 'undefined') {\n found = fn(breakable, sourceData.undirected, target, callback);\n\n if (breakable && found) return found;\n }\n }\n\n return;\n}\n\n/**\n * Function creating an array of edges for the given path.\n *\n * @param {string} type - Type of edges to retrieve.\n * @param {boolean} multi - Whether the graph is multi.\n * @param {string} direction - In or out?\n * @param {NodeData} sourceData - Source node's data.\n * @param {any} target - Target node.\n * @return {array} - Array of edges.\n */\nfunction createEdgeArrayForPath(type, multi, direction, sourceData, target) {\n const edges = []; // TODO: possibility to know size beforehand or factorize with map\n\n forEachEdgeForPath(\n false,\n type,\n multi,\n direction,\n sourceData,\n target,\n function (key) {\n edges.push(key);\n }\n );\n\n return edges;\n}\n\n/**\n * Function returning an iterator over edges for the given path.\n *\n * @param {string} type - Type of edges to retrieve.\n * @param {string} direction - In or out?\n * @param {NodeData} sourceData - Source node's data.\n * @param {string} target - Target node.\n * @param {function} callback - Function to call.\n */\nfunction createEdgeIteratorForPath(type, direction, sourceData, target) {\n let iterator = Iterator.empty();\n\n if (type !== 'undirected') {\n if (\n typeof sourceData.in !== 'undefined' &&\n direction !== 'out' &&\n target in sourceData.in\n )\n iterator = chain(iterator, createIteratorForKey(sourceData.in, target));\n\n if (\n typeof sourceData.out !== 'undefined' &&\n direction !== 'in' &&\n target in sourceData.out &&\n (direction || sourceData.key !== target)\n )\n iterator = chain(iterator, createIteratorForKey(sourceData.out, target));\n }\n\n if (type !== 'directed') {\n if (\n typeof sourceData.undirected !== 'undefined' &&\n target in sourceData.undirected\n )\n iterator = chain(\n iterator,\n createIteratorForKey(sourceData.undirected, target)\n );\n }\n\n return iterator;\n}\n\n/**\n * Function attaching an edge array creator method to the Graph prototype.\n *\n * @param {function} Class - Target class.\n * @param {object} description - Method description.\n */\nfunction attachEdgeArrayCreator(Class, description) {\n const {name, type, direction} = description;\n\n /**\n * Function returning an array of certain edges.\n *\n * Arity 0: Return all the relevant edges.\n *\n * Arity 1: Return all of a node's relevant edges.\n * @param {any} node - Target node.\n *\n * Arity 2: Return the relevant edges across the given path.\n * @param {any} source - Source node.\n * @param {any} target - Target node.\n *\n * @return {array|number} - The edges or the number of edges.\n *\n * @throws {Error} - Will throw if there are too many arguments.\n */\n Class.prototype[name] = function (source, target) {\n // Early termination\n if (type !== 'mixed' && this.type !== 'mixed' && type !== this.type)\n return [];\n\n if (!arguments.length) return createEdgeArray(this, type);\n\n if (arguments.length === 1) {\n source = '' + source;\n\n const nodeData = this._nodes.get(source);\n\n if (typeof nodeData === 'undefined')\n throw new NotFoundGraphError(\n `Graph.${name}: could not find the \"${source}\" node in the graph.`\n );\n\n // Iterating over a node's edges\n return createEdgeArrayForNode(\n this.multi,\n type === 'mixed' ? this.type : type,\n direction,\n nodeData\n );\n }\n\n if (arguments.length === 2) {\n source = '' + source;\n target = '' + target;\n\n const sourceData = this._nodes.get(source);\n\n if (!sourceData)\n throw new NotFoundGraphError(\n `Graph.${name}: could not find the \"${source}\" source node in the graph.`\n );\n\n if (!this._nodes.has(target))\n throw new NotFoundGraphError(\n `Graph.${name}: could not find the \"${target}\" target node in the graph.`\n );\n\n // Iterating over the edges between source & target\n return createEdgeArrayForPath(\n type,\n this.multi,\n direction,\n sourceData,\n target\n );\n }\n\n throw new InvalidArgumentsGraphError(\n `Graph.${name}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`\n );\n };\n}\n\n/**\n * Function attaching a edge callback iterator method to the Graph prototype.\n *\n * @param {function} Class - Target class.\n * @param {object} description - Method description.\n */\nfunction attachForEachEdge(Class, description) {\n const {name, type, direction} = description;\n\n const forEachName = 'forEach' + name[0].toUpperCase() + name.slice(1, -1);\n\n /**\n * Function iterating over the graph's relevant edges by applying the given\n * callback.\n *\n * Arity 1: Iterate over all the relevant edges.\n * @param {function} callback - Callback to use.\n *\n * Arity 2: Iterate over all of a node's relevant edges.\n * @param {any} node - Target node.\n * @param {function} callback - Callback to use.\n *\n * Arity 3: Iterate over the relevant edges across the given path.\n * @param {any} source - Source node.\n * @param {any} target - Target node.\n * @param {function} callback - Callback to use.\n *\n * @return {undefined}\n *\n * @throws {Error} - Will throw if there are too many arguments.\n */\n Class.prototype[forEachName] = function (source, target, callback) {\n // Early termination\n if (type !== 'mixed' && this.type !== 'mixed' && type !== this.type) return;\n\n if (arguments.length === 1) {\n callback = source;\n return forEachEdge(false, this, type, callback);\n }\n\n if (arguments.length === 2) {\n source = '' + source;\n callback = target;\n\n const nodeData = this._nodes.get(source);\n\n if (typeof nodeData === 'undefined')\n throw new NotFoundGraphError(\n `Graph.${forEachName}: could not find the \"${source}\" node in the graph.`\n );\n\n // Iterating over a node's edges\n // TODO: maybe attach the sub method to the instance dynamically?\n return forEachEdgeForNode(\n false,\n this.multi,\n type === 'mixed' ? this.type : type,\n direction,\n nodeData,\n callback\n );\n }\n\n if (arguments.length === 3) {\n source = '' + source;\n target = '' + target;\n\n const sourceData = this._nodes.get(source);\n\n if (!sourceData)\n throw new NotFoundGraphError(\n `Graph.${forEachName}: could not find the \"${source}\" source node in the graph.`\n );\n\n if (!this._nodes.has(target))\n throw new NotFoundGraphError(\n `Graph.${forEachName}: could not find the \"${target}\" target node in the graph.`\n );\n\n // Iterating over the edges between source & target\n return forEachEdgeForPath(\n false,\n type,\n this.multi,\n direction,\n sourceData,\n target,\n callback\n );\n }\n\n throw new InvalidArgumentsGraphError(\n `Graph.${forEachName}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`\n );\n };\n\n /**\n * Function mapping the graph's relevant edges by applying the given\n * callback.\n *\n * Arity 1: Map all the relevant edges.\n * @param {function} callback - Callback to use.\n *\n * Arity 2: Map all of a node's relevant edges.\n * @param {any} node - Target node.\n * @param {function} callback - Callback to use.\n *\n * Arity 3: Map the relevant edges across the given path.\n * @param {any} source - Source node.\n * @param {any} target - Target node.\n * @param {function} callback - Callback to use.\n *\n * @return {undefined}\n *\n * @throws {Error} - Will throw if there are too many arguments.\n */\n const mapName = 'map' + name[0].toUpperCase() + name.slice(1);\n\n Class.prototype[mapName] = function () {\n const args = Array.prototype.slice.call(arguments);\n const callback = args.pop();\n\n let result;\n\n // We know the result length beforehand\n if (args.length === 0) {\n let length = 0;\n\n if (type !== 'directed') length += this.undirectedSize;\n if (type !== 'undirected') length += this.directedSize;\n\n result = new Array(length);\n\n let i = 0;\n\n args.push((e, ea, s, t, sa, ta, u) => {\n result[i++] = callback(e, ea, s, t, sa, ta, u);\n });\n }\n\n // We don't know the result length beforehand\n // TODO: we can in some instances of simple graphs, knowing degree\n else {\n result = [];\n\n args.push((e, ea, s, t, sa, ta, u) => {\n result.push(callback(e, ea, s, t, sa, ta, u));\n });\n }\n\n this[forEachName].apply(this, args);\n\n return result;\n };\n\n /**\n * Function filtering the graph's relevant edges using the provided predicate\n * function.\n *\n * Arity 1: Filter all the relevant edges.\n * @param {function} predicate - Predicate to use.\n *\n * Arity 2: Filter all of a node's relevant edges.\n * @param {any} node - Target node.\n * @param {function} predicate - Predicate to use.\n *\n * Arity 3: Filter the relevant edges across the given path.\n * @param {any} source - Source node.\n * @param {any} target - Target node.\n * @param {function} predicate - Predicate to use.\n *\n * @return {undefined}\n *\n * @throws {Error} - Will throw if there are too many arguments.\n */\n const filterName = 'filter' + name[0].toUpperCase() + name.slice(1);\n\n Class.prototype[filterName] = function () {\n const args = Array.prototype.slice.call(arguments);\n const callback = args.pop();\n\n const result = [];\n\n args.push((e, ea, s, t, sa, ta, u) => {\n if (callback(e, ea, s, t, sa, ta, u)) result.push(e);\n });\n\n this[forEachName].apply(this, args);\n\n return result;\n };\n\n /**\n * Function reducing the graph's relevant edges using the provided accumulator\n * function.\n *\n * Arity 1: Reduce all the relevant edges.\n * @param {function} accumulator - Accumulator to use.\n * @param {any} initialValue - Initial value.\n *\n * Arity 2: Reduce all of a node's relevant edges.\n * @param {any} node - Target node.\n * @param {function} accumulator - Accumulator to use.\n * @param {any} initialValue - Initial value.\n *\n * Arity 3: Reduce the relevant edges across the given path.\n * @param {any} source - Source node.\n * @param {any} target - Target node.\n * @param {function} accumulator - Accumulator to use.\n * @param {any} initialValue - Initial value.\n *\n * @return {undefined}\n *\n * @throws {Error} - Will throw if there are too many arguments.\n */\n const reduceName = 'reduce' + name[0].toUpperCase() + name.slice(1);\n\n Class.prototype[reduceName] = function () {\n let args = Array.prototype.slice.call(arguments);\n\n if (args.length < 2 || args.length > 4) {\n throw new InvalidArgumentsGraphError(\n `Graph.${reduceName}: invalid number of arguments (expecting 2, 3 or 4 and got ${args.length}).`\n );\n }\n\n if (\n typeof args[args.length - 1] === 'function' &&\n typeof args[args.length - 2] !== 'function'\n ) {\n throw new InvalidArgumentsGraphError(\n `Graph.${reduceName}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`\n );\n }\n\n let callback;\n let initialValue;\n\n if (args.length === 2) {\n callback = args[0];\n initialValue = args[1];\n args = [];\n } else if (args.length === 3) {\n callback = args[1];\n initialValue = args[2];\n args = [args[0]];\n } else if (args.length === 4) {\n callback = args[2];\n initialValue = args[3];\n args = [args[0], args[1]];\n }\n\n let accumulator = initialValue;\n\n args.push((e, ea, s, t, sa, ta, u) => {\n accumulator = callback(accumulator, e, ea, s, t, sa, ta, u);\n });\n\n this[forEachName].apply(this, args);\n\n return accumulator;\n };\n}\n\n/**\n * Function attaching a breakable edge callback iterator method to the Graph\n * prototype.\n *\n * @param {function} Class - Target class.\n * @param {object} description - Method description.\n */\nfunction attachFindEdge(Class, description) {\n const {name, type, direction} = description;\n\n const findEdgeName = 'find' + name[0].toUpperCase() + name.slice(1, -1);\n\n /**\n * Function iterating over the graph's relevant edges in order to match\n * one of them using the provided predicate function.\n *\n * Arity 1: Iterate over all the relevant edges.\n * @param {function} callback - Callback to use.\n *\n * Arity 2: Iterate over all of a node's relevant edges.\n * @param {any} node - Target node.\n * @param {function} callback - Callback to use.\n *\n * Arity 3: Iterate over the relevant edges across the given path.\n * @param {any} source - Source node.\n * @param {any} target - Target node.\n * @param {function} callback - Callback to use.\n *\n * @return {undefined}\n *\n * @throws {Error} - Will throw if there are too many arguments.\n */\n Class.prototype[findEdgeName] = function (source, target, callback) {\n // Early termination\n if (type !== 'mixed' && this.type !== 'mixed' && type !== this.type)\n return false;\n\n if (arguments.length === 1) {\n callback = source;\n return forEachEdge(true, this, type, callback);\n }\n\n if (arguments.length === 2) {\n source = '' + source;\n callback = target;\n\n const nodeData = this._nodes.get(source);\n\n if (typeof nodeData === 'undefined')\n throw new NotFoundGraphError(\n `Graph.${findEdgeName}: could not find the \"${source}\" node in the graph.`\n );\n\n // Iterating over a node's edges\n // TODO: maybe attach the sub method to the instance dynamically?\n return forEachEdgeForNode(\n true,\n this.multi,\n type === 'mixed' ? this.type : type,\n direction,\n nodeData,\n callback\n );\n }\n\n if (arguments.length === 3) {\n source = '' + source;\n target = '' + target;\n\n const sourceData = this._nodes.get(source);\n\n if (!sourceData)\n throw new NotFoundGraphError(\n `Graph.${findEdgeName}: could not find the \"${source}\" source node in the graph.`\n );\n\n if (!this._nodes.has(target))\n throw new NotFoundGraphError(\n `Graph.${findEdgeName}: could not find the \"${target}\" target node in the graph.`\n );\n\n // Iterating over the edges between source & target\n return forEachEdgeForPath(\n true,\n type,\n this.multi,\n direction,\n sourceData,\n target,\n callback\n );\n }\n\n throw new InvalidArgumentsGraphError(\n `Graph.${findEdgeName}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`\n );\n };\n\n /**\n * Function iterating over the graph's relevant edges in order to assert\n * whether any one of them matches the provided predicate function.\n *\n * Arity 1: Iterate over all the relevant edges.\n * @param {function} callback - Callback to use.\n *\n * Arity 2: Iterate over all of a node's relevant edges.\n * @param {any} node - Target node.\n * @param {function} callback - Callback to use.\n *\n * Arity 3: Iterate over the relevant edges across the given path.\n * @param {any} source - Source node.\n * @param {any} target - Target node.\n * @param {function} callback - Callback to use.\n *\n * @return {undefined}\n *\n * @throws {Error} - Will throw if there are too many arguments.\n */\n const someName = 'some' + name[0].toUpperCase() + name.slice(1, -1);\n\n Class.prototype[someName] = function () {\n const args = Array.prototype.slice.call(arguments);\n const callback = args.pop();\n\n args.push((e, ea, s, t, sa, ta, u) => {\n return callback(e, ea, s, t, sa, ta, u);\n });\n\n const found = this[findEdgeName].apply(this, args);\n\n if (found) return true;\n\n return false;\n };\n\n /**\n * Function iterating over the graph's relevant edges in order to assert\n * whether all of them matche the provided predicate function.\n *\n * Arity 1: Iterate over all the relevant edges.\n * @param {function} callback - Callback to use.\n *\n * Arity 2: Iterate over all of a node's relevant edges.\n * @param {any} node - Target node.\n * @param {function} callback - Callback to use.\n *\n * Arity 3: Iterate over the relevant edges across the given path.\n * @param {any} source - Source node.\n * @param {any} target - Target node.\n * @param {function} callback - Callback to use.\n *\n * @return {undefined}\n *\n * @throws {Error} - Will throw if there are too many arguments.\n */\n const everyName = 'every' + name[0].toUpperCase() + name.slice(1, -1);\n\n Class.prototype[everyName] = function () {\n const args = Array.prototype.slice.call(arguments);\n const callback = args.pop();\n\n args.push((e, ea, s, t, sa, ta, u) => {\n return !callback(e, ea, s, t, sa, ta, u);\n });\n\n const found = this[findEdgeName].apply(this, args);\n\n if (found) return false;\n\n return true;\n };\n}\n\n/**\n * Function attaching an edge iterator method to the Graph prototype.\n *\n * @param {function} Class - Target class.\n * @param {object} description - Method description.\n */\nfunction attachEdgeIteratorCreator(Class, description) {\n const {name: originalName, type, direction} = description;\n\n const name = originalName.slice(0, -1) + 'Entries';\n\n /**\n * Function returning an iterator over the graph's edges.\n *\n * Arity 0: Iterate over all the relevant edges.\n *\n * Arity 1: Iterate over all of a node's relevant edges.\n * @param {any} node - Target node.\n *\n * Arity 2: Iterate over the relevant edges across the given path.\n * @param {any} source - Source node.\n * @param {any} target - Target node.\n *\n * @return {array|number} - The edges or the number of edges.\n *\n * @throws {Error} - Will throw if there are too many arguments.\n */\n Class.prototype[name] = function (source, target) {\n // Early termination\n if (type !== 'mixed' && this.type !== 'mixed' && type !== this.type)\n return Iterator.empty();\n\n if (!arguments.length) return createEdgeIterator(this, type);\n\n if (arguments.length === 1) {\n source = '' + source;\n\n const sourceData = this._nodes.get(source);\n\n if (!sourceData)\n throw new NotFoundGraphError(\n `Graph.${name}: could not find the \"${source}\" node in the graph.`\n );\n\n // Iterating over a node's edges\n return createEdgeIteratorForNode(type, direction, sourceData);\n }\n\n if (arguments.length === 2) {\n source = '' + source;\n target = '' + target;\n\n const sourceData = this._nodes.get(source);\n\n if (!sourceData)\n throw new NotFoundGraphError(\n `Graph.${name}: could not find the \"${source}\" source node in the graph.`\n );\n\n if (!this._nodes.has(target))\n throw new NotFoundGraphError(\n `Graph.${name}: could not find the \"${target}\" target node in the graph.`\n );\n\n // Iterating over the edges between source & target\n return createEdgeIteratorForPath(type, direction, sourceData, target);\n }\n\n throw new InvalidArgumentsGraphError(\n `Graph.${name}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`\n );\n };\n}\n\n/**\n * Function attaching every edge iteration method to the Graph class.\n *\n * @param {function} Graph - Graph class.\n */\nexport default function attachEdgeIterationMethods(Graph) {\n EDGES_ITERATION.forEach(description => {\n attachEdgeArrayCreator(Graph, description);\n attachForEachEdge(Graph, description);\n attachFindEdge(Graph, description);\n attachEdgeIteratorCreator(Graph, description);\n });\n}\n","/**\n * Graphology Neighbor Iteration\n * ==============================\n *\n * Attaching some methods to the Graph class to be able to iterate over\n * neighbors.\n */\nimport Iterator from 'obliterator/iterator';\nimport chain from 'obliterator/chain';\n\nimport {NotFoundGraphError, InvalidArgumentsGraphError} from '../errors';\n\n/**\n * Definitions.\n */\nconst NEIGHBORS_ITERATION = [\n {\n name: 'neighbors',\n type: 'mixed'\n },\n {\n name: 'inNeighbors',\n type: 'directed',\n direction: 'in'\n },\n {\n name: 'outNeighbors',\n type: 'directed',\n direction: 'out'\n },\n {\n name: 'inboundNeighbors',\n type: 'mixed',\n direction: 'in'\n },\n {\n name: 'outboundNeighbors',\n type: 'mixed',\n direction: 'out'\n },\n {\n name: 'directedNeighbors',\n type: 'directed'\n },\n {\n name: 'undirectedNeighbors',\n type: 'undirected'\n }\n];\n\n/**\n * Helpers.\n */\nfunction CompositeSetWrapper() {\n this.A = null;\n this.B = null;\n}\n\nCompositeSetWrapper.prototype.wrap = function (set) {\n if (this.A === null) this.A = set;\n else if (this.B === null) this.B = set;\n};\n\nCompositeSetWrapper.prototype.has = function (key) {\n if (this.A !== null && key in this.A) return true;\n if (this.B !== null && key in this.B) return true;\n return false;\n};\n\n/**\n * Function iterating over the given node's relevant neighbors to match\n * one of them using a predicated function.\n *\n * @param {string} type - Type of neighbors.\n * @param {string} direction - Direction.\n * @param {any} nodeData - Target node's data.\n * @param {function} callback - Callback to use.\n */\nfunction forEachInObjectOnce(breakable, visited, nodeData, object, callback) {\n for (const k in object) {\n const edgeData = object[k];\n\n const sourceData = edgeData.source;\n const targetData = edgeData.target;\n\n const neighborData = sourceData === nodeData ? targetData : sourceData;\n\n if (visited && visited.has(neighborData.key)) continue;\n\n const shouldBreak = callback(neighborData.key, neighborData.attributes);\n\n if (breakable && shouldBreak) return neighborData.key;\n }\n\n return;\n}\n\nfunction forEachNeighbor(breakable, type, direction, nodeData, callback) {\n // If we want only undirected or in or out, we can roll some optimizations\n if (type !== 'mixed') {\n if (type === 'undirected')\n return forEachInObjectOnce(\n breakable,\n null,\n nodeData,\n nodeData.undirected,\n callback\n );\n\n if (typeof direction === 'string')\n return forEachInObjectOnce(\n breakable,\n null,\n nodeData,\n nodeData[direction],\n callback\n );\n }\n\n // Else we need to keep a set of neighbors not to return duplicates\n // We cheat by querying the other adjacencies\n const visited = new CompositeSetWrapper();\n\n let found;\n\n if (type !== 'undirected') {\n if (direction !== 'out') {\n found = forEachInObjectOnce(\n breakable,\n null,\n nodeData,\n nodeData.in,\n callback\n );\n\n if (breakable && found) return found;\n\n visited.wrap(nodeData.in);\n }\n if (direction !== 'in') {\n found = forEachInObjectOnce(\n breakable,\n visited,\n nodeData,\n nodeData.out,\n callback\n );\n\n if (breakable && found) return found;\n\n visited.wrap(nodeData.out);\n }\n }\n\n if (type !== 'directed') {\n found = forEachInObjectOnce(\n breakable,\n visited,\n nodeData,\n nodeData.undirected,\n callback\n );\n\n if (breakable && found) return found;\n }\n\n return;\n}\n\n/**\n * Function creating an array of relevant neighbors for the given node.\n *\n * @param {string} type - Type of neighbors.\n * @param {string} direction - Direction.\n * @param {any} nodeData - Target node's data.\n * @return {Array} - The list of neighbors.\n */\nfunction createNeighborArrayForNode(type, direction, nodeData) {\n // If we want only undirected or in or out, we can roll some optimizations\n if (type !== 'mixed') {\n if (type === 'undirected') return Object.keys(nodeData.undirected);\n\n if (typeof direction === 'string') return Object.keys(nodeData[direction]);\n }\n\n const neighbors = [];\n\n forEachNeighbor(false, type, direction, nodeData, function (key) {\n neighbors.push(key);\n });\n\n return neighbors;\n}\n\n/**\n * Function returning an iterator over the given node's relevant neighbors.\n *\n * @param {string} type - Type of neighbors.\n * @param {string} direction - Direction.\n * @param {any} nodeData - Target node's data.\n * @return {Iterator}\n */\nfunction createDedupedObjectIterator(visited, nodeData, object) {\n const keys = Object.keys(object);\n const l = keys.length;\n\n let i = 0;\n\n return new Iterator(function next() {\n let neighborData = null;\n\n do {\n if (i >= l) {\n if (visited) visited.wrap(object);\n return {done: true};\n }\n\n const edgeData = object[keys[i++]];\n\n const sourceData = edgeData.source;\n const targetData = edgeData.target;\n\n neighborData = sourceData === nodeData ? targetData : sourceData;\n\n if (visited && visited.has(neighborData.key)) {\n neighborData = null;\n continue;\n }\n } while (neighborData === null);\n\n return {\n done: false,\n value: {neighbor: neighborData.key, attributes: neighborData.attributes}\n };\n });\n}\n\nfunction createNeighborIterator(type, direction, nodeData) {\n // If we want only undirected or in or out, we can roll some optimizations\n if (type !== 'mixed') {\n if (type === 'undirected')\n return createDedupedObjectIterator(null, nodeData, nodeData.undirected);\n\n if (typeof direction === 'string')\n return createDedupedObjectIterator(null, nodeData, nodeData[direction]);\n }\n\n let iterator = Iterator.empty();\n\n // Else we need to keep a set of neighbors not to return duplicates\n // We cheat by querying the other adjacencies\n const visited = new CompositeSetWrapper();\n\n if (type !== 'undirected') {\n if (direction !== 'out') {\n iterator = chain(\n iterator,\n createDedupedObjectIterator(visited, nodeData, nodeData.in)\n );\n }\n if (direction !== 'in') {\n iterator = chain(\n iterator,\n createDedupedObjectIterator(visited, nodeData, nodeData.out)\n );\n }\n }\n\n if (type !== 'directed') {\n iterator = chain(\n iterator,\n createDedupedObjectIterator(visited, nodeData, nodeData.undirected)\n );\n }\n\n return iterator;\n}\n\n/**\n * Function attaching a neighbors array creator method to the Graph prototype.\n *\n * @param {function} Class - Target class.\n * @param {object} description - Method description.\n */\nfunction attachNeighborArrayCreator(Class, description) {\n const {name, type, direction} = description;\n\n /**\n * Function returning an array of certain neighbors.\n *\n * @param {any} node - Target node.\n * @return {array} - The neighbors of neighbors.\n *\n * @throws {Error} - Will throw if node is not found in the graph.\n */\n Class.prototype[name] = function (node) {\n // Early termination\n if (type !== 'mixed' && this.type !== 'mixed' && type !== this.type)\n return [];\n\n node = '' + node;\n\n const nodeData = this._nodes.get(node);\n\n if (typeof nodeData === 'undefined')\n throw new NotFoundGraphError(\n `Graph.${name}: could not find the \"${node}\" node in the graph.`\n );\n\n // Here, we want to iterate over a node's relevant neighbors\n return createNeighborArrayForNode(\n type === 'mixed' ? this.type : type,\n direction,\n nodeData\n );\n };\n}\n\n/**\n * Function attaching a neighbors callback iterator method to the Graph prototype.\n *\n * @param {function} Class - Target class.\n * @param {object} description - Method description.\n */\nfunction attachForEachNeighbor(Class, description) {\n const {name, type, direction} = description;\n\n const forEachName = 'forEach' + name[0].toUpperCase() + name.slice(1, -1);\n\n /**\n * Function iterating over all the relevant neighbors using a callback.\n *\n * @param {any} node - Target node.\n * @param {function} callback - Callback to use.\n * @return {undefined}\n *\n * @throws {Error} - Will throw if there are too many arguments.\n */\n Class.prototype[forEachName] = function (node, callback) {\n // Early termination\n if (type !== 'mixed' && this.type !== 'mixed' && type !== this.type) return;\n\n node = '' + node;\n\n const nodeData = this._nodes.get(node);\n\n if (typeof nodeData === 'undefined')\n throw new NotFoundGraphError(\n `Graph.${forEachName}: could not find the \"${node}\" node in the graph.`\n );\n\n // Here, we want to iterate over a node's relevant neighbors\n forEachNeighbor(\n false,\n type === 'mixed' ? this.type : type,\n direction,\n nodeData,\n callback\n );\n };\n\n /**\n * Function mapping the relevant neighbors using a callback.\n *\n * @param {any} node - Target node.\n * @param {function} callback - Callback to use.\n *\n * @throws {Error} - Will throw if there are too many arguments.\n */\n const mapName = 'map' + name[0].toUpperCase() + name.slice(1);\n\n Class.prototype[mapName] = function (node, callback) {\n // TODO: optimize when size is known beforehand\n const result = [];\n\n this[forEachName](node, (n, a) => {\n result.push(callback(n, a));\n });\n\n return result;\n };\n\n /**\n * Function filtering the relevant neighbors using a callback.\n *\n * @param {any} node - Target node.\n * @param {function} callback - Callback to use.\n *\n * @throws {Error} - Will throw if there are too many arguments.\n */\n const filterName = 'filter' + name[0].toUpperCase() + name.slice(1);\n\n Class.prototype[filterName] = function (node, callback) {\n const result = [];\n\n this[forEachName](node, (n, a) => {\n if (callback(n, a)) result.push(n);\n });\n\n return result;\n };\n\n /**\n * Function reducing the relevant neighbors using a callback.\n *\n * @param {any} node - Target node.\n * @param {function} callback - Callback to use.\n *\n * @throws {Error} - Will throw if there are too many arguments.\n */\n const reduceName = 'reduce' + name[0].toUpperCase() + name.slice(1);\n\n Class.prototype[reduceName] = function (node, callback, initialValue) {\n if (arguments.length < 3)\n throw new InvalidArgumentsGraphError(\n `Graph.${reduceName}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`\n );\n\n let accumulator = initialValue;\n\n this[forEachName](node, (n, a) => {\n accumulator = callback(accumulator, n, a);\n });\n\n return accumulator;\n };\n}\n\n/**\n * Function attaching a breakable neighbors callback iterator method to the\n * Graph prototype.\n *\n * @param {function} Class - Target class.\n * @param {object} description - Method description.\n */\nfunction attachFindNeighbor(Class, description) {\n const {name, type, direction} = description;\n\n const capitalizedSingular = name[0].toUpperCase() + name.slice(1, -1);\n\n const findName = 'find' + capitalizedSingular;\n\n /**\n * Function iterating over all the relevant neighbors using a callback.\n *\n * @param {any} node - Target node.\n * @param {function} callback - Callback to use.\n * @return {undefined}\n *\n * @throws {Error} - Will throw if there are too many arguments.\n */\n Class.prototype[findName] = function (node, callback) {\n // Early termination\n if (type !== 'mixed' && this.type !== 'mixed' && type !== this.type) return;\n\n node = '' + node;\n\n const nodeData = this._nodes.get(node);\n\n if (typeof nodeData === 'undefined')\n throw new NotFoundGraphError(\n `Graph.${findName}: could not find the \"${node}\" node in the graph.`\n );\n\n // Here, we want to iterate over a node's relevant neighbors\n return forEachNeighbor(\n true,\n type === 'mixed' ? this.type : type,\n direction,\n nodeData,\n callback\n );\n };\n\n /**\n * Function iterating over all the relevant neighbors to find if any of them\n * matches the given predicate.\n *\n * @param {any} node - Target node.\n * @param {function} callback - Callback to use.\n * @return {boolean}\n *\n * @throws {Error} - Will throw if there are too many arguments.\n */\n const someName = 'some' + capitalizedSingular;\n\n Class.prototype[someName] = function (node, callback) {\n const found = this[findName](node, callback);\n\n if (found) return true;\n\n return false;\n };\n\n /**\n * Function iterating over all the relevant neighbors to find if all of them\n * matche the given predicate.\n *\n * @param {any} node - Target node.\n * @param {function} callback - Callback to use.\n * @return {boolean}\n *\n * @throws {Error} - Will throw if there are too many arguments.\n */\n const everyName = 'every' + capitalizedSingular;\n\n Class.prototype[everyName] = function (node, callback) {\n const found = this[findName](node, (n, a) => {\n return !callback(n, a);\n });\n\n if (found) return false;\n\n return true;\n };\n}\n\n/**\n * Function attaching a neighbors callback iterator method to the Graph prototype.\n *\n * @param {function} Class - Target class.\n * @param {object} description - Method description.\n */\nfunction attachNeighborIteratorCreator(Class, description) {\n const {name, type, direction} = description;\n\n const iteratorName = name.slice(0, -1) + 'Entries';\n\n /**\n * Function returning an iterator over all the relevant neighbors.\n *\n * @param {any} node - Target node.\n * @return {Iterator}\n *\n * @throws {Error} - Will throw if there are too many arguments.\n */\n Class.prototype[iteratorName] = function (node) {\n // Early termination\n if (type !== 'mixed' && this.type !== 'mixed' && type !== this.type)\n return Iterator.empty();\n\n node = '' + node;\n\n const nodeData = this._nodes.get(node);\n\n if (typeof nodeData === 'undefined')\n throw new NotFoundGraphError(\n `Graph.${iteratorName}: could not find the \"${node}\" node in the graph.`\n );\n\n // Here, we want to iterate over a node's relevant neighbors\n return createNeighborIterator(\n type === 'mixed' ? this.type : type,\n direction,\n nodeData\n );\n };\n}\n\n/**\n * Function attaching every neighbor iteration method to the Graph class.\n *\n * @param {function} Graph - Graph class.\n */\nexport default function attachNeighborIterationMethods(Graph) {\n NEIGHBORS_ITERATION.forEach(description => {\n attachNeighborArrayCreator(Graph, description);\n attachForEachNeighbor(Graph, description);\n attachFindNeighbor(Graph, description);\n attachNeighborIteratorCreator(Graph, description);\n });\n}\n","/**\n * Graphology Adjacency Iteration\n * ===============================\n *\n * Attaching some methods to the Graph class to be able to iterate over a\n * graph's adjacency.\n */\n\n/**\n * Function iterating over a simple graph's adjacency using a callback.\n *\n * @param {boolean} breakable - Can we break?\n * @param {boolean} assymetric - Whether to emit undirected edges only once.\n * @param {boolean} disconnectedNodes - Whether to emit disconnected nodes.\n * @param {Graph} graph - Target Graph instance.\n * @param {callback} function - Iteration callback.\n */\nexport function forEachAdjacency(\n breakable,\n assymetric,\n disconnectedNodes,\n graph,\n callback\n) {\n const iterator = graph._nodes.values();\n\n const type = graph.type;\n\n let step, sourceData, neighbor, adj, edgeData, targetData, shouldBreak;\n\n while (((step = iterator.next()), step.done !== true)) {\n let hasEdges = false;\n\n sourceData = step.value;\n\n if (type !== 'undirected') {\n adj = sourceData.out;\n\n for (neighbor in adj) {\n edgeData = adj[neighbor];\n\n do {\n targetData = edgeData.target;\n\n hasEdges = true;\n shouldBreak = callback(\n sourceData.key,\n targetData.key,\n sourceData.attributes,\n targetData.attributes,\n edgeData.key,\n edgeData.attributes,\n edgeData.undirected\n );\n\n if (breakable && shouldBreak) return edgeData;\n\n edgeData = edgeData.next;\n } while (edgeData);\n }\n }\n\n if (type !== 'directed') {\n adj = sourceData.undirected;\n\n for (neighbor in adj) {\n if (assymetric && sourceData.key > neighbor) continue;\n\n edgeData = adj[neighbor];\n\n do {\n targetData = edgeData.target;\n\n if (targetData.key !== neighbor) targetData = edgeData.source;\n\n hasEdges = true;\n shouldBreak = callback(\n sourceData.key,\n targetData.key,\n sourceData.attributes,\n targetData.attributes,\n edgeData.key,\n edgeData.attributes,\n edgeData.undirected\n );\n\n if (breakable && shouldBreak) return edgeData;\n\n edgeData = edgeData.next;\n } while (edgeData);\n }\n }\n\n if (disconnectedNodes && !hasEdges) {\n shouldBreak = callback(\n sourceData.key,\n null,\n sourceData.attributes,\n null,\n null,\n null,\n null\n );\n\n if (breakable && shouldBreak) return null;\n }\n }\n\n return;\n}\n","/**\n * Graphology Serialization Utilities\n * ===================================\n *\n * Collection of functions used by the graph serialization schemes.\n */\nimport {InvalidArgumentsGraphError} from './errors';\nimport {assign, isPlainObject, isEmpty} from './utils';\n\n/**\n * Formats internal node data into a serialized node.\n *\n * @param {any} key - The node's key.\n * @param {object} data - Internal node's data.\n * @return {array} - The serialized node.\n */\nexport function serializeNode(key, data) {\n const serialized = {key};\n\n if (!isEmpty(data.attributes))\n serialized.attributes = assign({}, data.attributes);\n\n return serialized;\n}\n\n/**\n * Formats internal edge data into a serialized edge.\n *\n * @param {string} type - The graph's type.\n * @param {any} key - The edge's key.\n * @param {object} data - Internal edge's data.\n * @return {array} - The serialized edge.\n */\nexport function serializeEdge(type, key, data) {\n const serialized = {\n key,\n source: data.source.key,\n target: data.target.key\n };\n\n if (!isEmpty(data.attributes))\n serialized.attributes = assign({}, data.attributes);\n\n if (type === 'mixed' && data.undirected) serialized.undirected = true;\n\n return serialized;\n}\n\n/**\n * Checks whether the given value is a serialized node.\n *\n * @param {mixed} value - Target value.\n * @return {string|null}\n */\nexport function validateSerializedNode(value) {\n if (!isPlainObject(value))\n throw new InvalidArgumentsGraphError(\n 'Graph.import: invalid serialized node. A serialized node should be a plain object with at least a \"key\" property.'\n );\n\n if (!('key' in value))\n throw new InvalidArgumentsGraphError(\n 'Graph.import: serialized node is missing its key.'\n );\n\n if (\n 'attributes' in value &&\n (!isPlainObject(value.attributes) || value.attributes === null)\n )\n throw new InvalidArgumentsGraphError(\n 'Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.'\n );\n}\n\n/**\n * Checks whether the given value is a serialized edge.\n *\n * @param {mixed} value - Target value.\n * @return {string|null}\n */\nexport function validateSerializedEdge(value) {\n if (!isPlainObject(value))\n throw new InvalidArgumentsGraphError(\n 'Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a \"source\" & \"target\" property.'\n );\n\n if (!('source' in value))\n throw new InvalidArgumentsGraphError(\n 'Graph.import: serialized edge is missing its source.'\n );\n\n if (!('target' in value))\n throw new InvalidArgumentsGraphError(\n 'Graph.import: serialized edge is missing its target.'\n );\n\n if (\n 'attributes' in value &&\n (!isPlainObject(value.attributes) || value.attributes === null)\n )\n throw new InvalidArgumentsGraphError(\n 'Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.'\n );\n\n if ('undirected' in value && typeof value.undirected !== 'boolean')\n throw new InvalidArgumentsGraphError(\n 'Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.'\n );\n}\n","/* eslint no-nested-ternary: 0 */\n/**\n * Graphology Reference Implementation\n * ====================================\n *\n * Reference implementation of the graphology specs.\n */\nimport {EventEmitter} from 'events';\nimport Iterator from 'obliterator/iterator';\nimport take from 'obliterator/take';\n\nimport {\n InvalidArgumentsGraphError,\n NotFoundGraphError,\n UsageGraphError\n} from './errors';\n\nimport {\n MixedNodeData,\n DirectedNodeData,\n UndirectedNodeData,\n EdgeData\n} from './data';\n\nimport attachNodeAttributesMethods from './attributes/nodes';\nimport attachEdgeAttributesMethods from './attributes/edges';\nimport attachEdgeIterationMethods from './iteration/edges';\nimport attachNeighborIterationMethods from './iteration/neighbors';\nimport {forEachAdjacency} from './iteration/adjacency';\n\nimport {\n serializeNode,\n serializeEdge,\n validateSerializedNode,\n validateSerializedEdge\n} from './serialization';\n\nimport {\n assign,\n getMatchingEdge,\n isPlainObject,\n privateProperty,\n readOnlyProperty,\n incrementalIdStartingFromRandomByte,\n validateHints\n} from './utils';\n\n/**\n * Constants.\n */\nconst INSTANCE_ID = incrementalIdStartingFromRandomByte();\n\n/**\n * Enums.\n */\nconst TYPES = new Set(['directed', 'undirected', 'mixed']);\n\nconst EMITTER_PROPS = new Set([\n 'domain',\n '_events',\n '_eventsCount',\n '_maxListeners'\n]);\n\nconst EDGE_ADD_METHODS = [\n {\n name: verb => `${verb}Edge`,\n generateKey: true\n },\n {\n name: verb => `${verb}DirectedEdge`,\n generateKey: true,\n type: 'directed'\n },\n {\n name: verb => `${verb}UndirectedEdge`,\n generateKey: true,\n type: 'undirected'\n },\n {\n name: verb => `${verb}EdgeWithKey`\n },\n {\n name: verb => `${verb}DirectedEdgeWithKey`,\n type: 'directed'\n },\n {\n name: verb => `${verb}UndirectedEdgeWithKey`,\n type: 'undirected'\n }\n];\n\n/**\n * Default options.\n */\nconst DEFAULTS = {\n allowSelfLoops: true,\n multi: false,\n type: 'mixed'\n};\n\n/**\n * Abstract functions used by the Graph class for various methods.\n */\n\n/**\n * Internal method used to add a node to the given graph\n *\n * @param {Graph} graph - Target graph.\n * @param {any} node - The node's key.\n * @param {object} [attributes] - Optional attributes.\n * @return {NodeData} - Created node data.\n */\nfunction addNode(graph, node, attributes) {\n if (attributes && !isPlainObject(attributes))\n throw new InvalidArgumentsGraphError(\n `Graph.addNode: invalid attributes. Expecting an object but got \"${attributes}\"`\n );\n\n // String coercion\n node = '' + node;\n attributes = attributes || {};\n\n if (graph._nodes.has(node))\n throw new UsageGraphError(\n `Graph.addNode: the \"${node}\" node already exist in the graph.`\n );\n\n const data = new graph.NodeDataClass(node, attributes);\n\n // Adding the node to internal register\n graph._nodes.set(node, data);\n\n // Emitting\n graph.emit('nodeAdded', {\n key: node,\n attributes\n });\n\n return data;\n}\n\n/**\n * Same as the above but without sanity checks because we call this in contexts\n * where necessary checks were already done.\n */\nfunction unsafeAddNode(graph, node, attributes) {\n const data = new graph.NodeDataClass(node, attributes);\n\n graph._nodes.set(node, data);\n\n graph.emit('nodeAdded', {\n key: node,\n attributes\n });\n\n return data;\n}\n\n/**\n * Internal method used to add an arbitrary edge to the given graph.\n *\n * @param {Graph} graph - Target graph.\n * @param {string} name - Name of the child method for errors.\n * @param {boolean} mustGenerateKey - Should the graph generate an id?\n * @param {boolean} undirected - Whether the edge is undirected.\n * @param {any} edge - The edge's key.\n * @param {any} source - The source node.\n * @param {any} target - The target node.\n * @param {object} [attributes] - Optional attributes.\n * @return {any} - The edge.\n *\n * @throws {Error} - Will throw if the graph is of the wrong type.\n * @throws {Error} - Will throw if the given attributes are not an object.\n * @throws {Error} - Will throw if source or target doesn't exist.\n * @throws {Error} - Will throw if the edge already exist.\n */\nfunction addEdge(\n graph,\n name,\n mustGenerateKey,\n undirected,\n edge,\n source,\n target,\n attributes\n) {\n // Checking validity of operation\n if (!undirected && graph.type === 'undirected')\n throw new UsageGraphError(\n `Graph.${name}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`\n );\n\n if (undirected && graph.type === 'directed')\n throw new UsageGraphError(\n `Graph.${name}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`\n );\n\n if (attributes && !isPlainObject(attributes))\n throw new InvalidArgumentsGraphError(\n `Graph.${name}: invalid attributes. Expecting an object but got \"${attributes}\"`\n );\n\n // Coercion of source & target:\n source = '' + source;\n target = '' + target;\n attributes = attributes || {};\n\n if (!graph.allowSelfLoops && source === target)\n throw new UsageGraphError(\n `Graph.${name}: source & target are the same (\"${source}\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`\n );\n\n const sourceData = graph._nodes.get(source),\n targetData = graph._nodes.get(target);\n\n if (!sourceData)\n throw new NotFoundGraphError(\n `Graph.${name}: source node \"${source}\" not found.`\n );\n\n if (!targetData)\n throw new NotFoundGraphError(\n `Graph.${name}: target node \"${target}\" not found.`\n );\n\n // Must the graph generate an id for this edge?\n const eventData = {\n key: null,\n undirected,\n source,\n target,\n attributes\n };\n\n if (mustGenerateKey) {\n // NOTE: in this case we can guarantee that the key does not already\n // exist and is already correctly casted as a string\n edge = graph._edgeKeyGenerator();\n } else {\n // Coercion of edge key\n edge = '' + edge;\n\n // Here, we have a key collision\n if (graph._edges.has(edge))\n throw new UsageGraphError(\n `Graph.${name}: the \"${edge}\" edge already exists in the graph.`\n );\n }\n\n // Here, we might have a source / target collision\n if (\n !graph.multi &&\n (undirected\n ? typeof sourceData.undirected[target] !== 'undefined'\n : typeof sourceData.out[target] !== 'undefined')\n ) {\n throw new UsageGraphError(\n `Graph.${name}: an edge linking \"${source}\" to \"${target}\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`\n );\n }\n\n // Storing some data\n const edgeData = new EdgeData(\n undirected,\n edge,\n sourceData,\n targetData,\n attributes\n );\n\n // Adding the edge to the internal register\n graph._edges.set(edge, edgeData);\n\n // Incrementing node degree counters\n const isSelfLoop = source === target;\n\n if (undirected) {\n sourceData.undirectedDegree++;\n targetData.undirectedDegree++;\n\n if (isSelfLoop) {\n sourceData.undirectedLoops++;\n graph._undirectedSelfLoopCount++;\n }\n } else {\n sourceData.outDegree++;\n targetData.inDegree++;\n\n if (isSelfLoop) {\n sourceData.directedLoops++;\n graph._directedSelfLoopCount++;\n }\n }\n\n // Updating relevant index\n if (graph.multi) edgeData.attachMulti();\n else edgeData.attach();\n\n if (undirected) graph._undirectedSize++;\n else graph._directedSize++;\n\n // Emitting\n eventData.key = edge;\n\n graph.emit('edgeAdded', eventData);\n\n return edge;\n}\n\n/**\n * Internal method used to add an arbitrary edge to the given graph.\n *\n * @param {Graph} graph - Target graph.\n * @param {string} name - Name of the child method for errors.\n * @param {boolean} mustGenerateKey - Should the graph generate an id?\n * @param {boolean} undirected - Whether the edge is undirected.\n * @param {any} edge - The edge's key.\n * @param {any} source - The source node.\n * @param {any} target - The target node.\n * @param {object} [attributes] - Optional attributes.\n * @param {boolean} [asUpdater] - Are we updating or merging?\n * @return {any} - The edge.\n *\n * @throws {Error} - Will throw if the graph is of the wrong type.\n * @throws {Error} - Will throw if the given attributes are not an object.\n * @throws {Error} - Will throw if source or target doesn't exist.\n * @throws {Error} - Will throw if the edge already exist.\n */\nfunction mergeEdge(\n graph,\n name,\n mustGenerateKey,\n undirected,\n edge,\n source,\n target,\n attributes,\n asUpdater\n) {\n // Checking validity of operation\n if (!undirected && graph.type === 'undirected')\n throw new UsageGraphError(\n `Graph.${name}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`\n );\n\n if (undirected && graph.type === 'directed')\n throw new UsageGraphError(\n `Graph.${name}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`\n );\n\n if (attributes) {\n if (asUpdater) {\n if (typeof attributes !== 'function')\n throw new InvalidArgumentsGraphError(\n `Graph.${name}: invalid updater function. Expecting a function but got \"${attributes}\"`\n );\n } else {\n if (!isPlainObject(attributes))\n throw new InvalidArgumentsGraphError(\n `Graph.${name}: invalid attributes. Expecting an object but got \"${attributes}\"`\n );\n }\n }\n\n // Coercion of source & target:\n source = '' + source;\n target = '' + target;\n\n let updater;\n\n if (asUpdater) {\n updater = attributes;\n attributes = undefined;\n }\n\n if (!graph.allowSelfLoops && source === target)\n throw new UsageGraphError(\n `Graph.${name}: source & target are the same (\"${source}\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`\n );\n\n let sourceData = graph._nodes.get(source);\n let targetData = graph._nodes.get(target);\n let edgeData;\n\n // Do we need to handle duplicate?\n let alreadyExistingEdgeData;\n\n if (!mustGenerateKey) {\n edgeData = graph._edges.get(edge);\n\n if (edgeData) {\n // Here, we need to ensure, if the user gave a key, that source & target\n // are consistent\n if (edgeData.source.key !== source || edgeData.target.key !== target) {\n // If source or target inconsistent\n if (\n !undirected ||\n edgeData.source.key !== target ||\n edgeData.target.key !== source\n ) {\n // If directed, or source/target aren't flipped\n throw new UsageGraphError(\n `Graph.${name}: inconsistency detected when attempting to merge the \"${edge}\" edge with \"${source}\" source & \"${target}\" target vs. (\"${edgeData.source.key}\", \"${edgeData.target.key}\").`\n );\n }\n }\n\n alreadyExistingEdgeData = edgeData;\n }\n }\n\n // Here, we might have a source / target collision\n if (!alreadyExistingEdgeData && !graph.multi && sourceData) {\n alreadyExistingEdgeData = undirected\n ? sourceData.undirected[target]\n : sourceData.out[target];\n }\n\n // Handling duplicates\n if (alreadyExistingEdgeData) {\n const info = [alreadyExistingEdgeData.key, false, false, false];\n\n // We can skip the attribute merging part if the user did not provide them\n if (asUpdater ? !updater : !attributes) return info;\n\n // Updating the attributes\n if (asUpdater) {\n const oldAttributes = alreadyExistingEdgeData.attributes;\n alreadyExistingEdgeData.attributes = updater(oldAttributes);\n\n graph.emit('edgeAttributesUpdated', {\n type: 'replace',\n key: alreadyExistingEdgeData.key,\n attributes: alreadyExistingEdgeData.attributes\n });\n }\n\n // Merging the attributes\n else {\n assign(alreadyExistingEdgeData.attributes, attributes);\n\n graph.emit('edgeAttributesUpdated', {\n type: 'merge',\n key: alreadyExistingEdgeData.key,\n attributes: alreadyExistingEdgeData.attributes,\n data: attributes\n });\n }\n\n return info;\n }\n\n attributes = attributes || {};\n\n if (asUpdater && updater) attributes = updater(attributes);\n\n // Must the graph generate an id for this edge?\n const eventData = {\n key: null,\n undirected,\n source,\n target,\n attributes\n };\n\n if (mustGenerateKey) {\n // NOTE: in this case we can guarantee that the key does not already\n // exist and is already correctly casted as a string\n edge = graph._edgeKeyGenerator();\n } else {\n // Coercion of edge key\n edge = '' + edge;\n\n // Here, we have a key collision\n if (graph._edges.has(edge))\n throw new UsageGraphError(\n `Graph.${name}: the \"${edge}\" edge already exists in the graph.`\n );\n }\n\n let sourceWasAdded = false;\n let targetWasAdded = false;\n\n if (!sourceData) {\n sourceData = unsafeAddNode(graph, source, {});\n sourceWasAdded = true;\n\n if (source === target) {\n targetData = sourceData;\n targetWasAdded = true;\n }\n }\n if (!targetData) {\n targetData = unsafeAddNode(graph, target, {});\n targetWasAdded = true;\n }\n\n // Storing some data\n edgeData = new EdgeData(undirected, edge, sourceData, targetData, attributes);\n\n // Adding the edge to the internal register\n graph._edges.set(edge, edgeData);\n\n // Incrementing node degree counters\n const isSelfLoop = source === target;\n\n if (undirected) {\n sourceData.undirectedDegree++;\n targetData.undirectedDegree++;\n\n if (isSelfLoop) {\n sourceData.undirectedLoops++;\n graph._undirectedSelfLoopCount++;\n }\n } else {\n sourceData.outDegree++;\n targetData.inDegree++;\n\n if (isSelfLoop) {\n sourceData.directedLoops++;\n graph._directedSelfLoopCount++;\n }\n }\n\n // Updating relevant index\n if (graph.multi) edgeData.attachMulti();\n else edgeData.attach();\n\n if (undirected) graph._undirectedSize++;\n else graph._directedSize++;\n\n // Emitting\n eventData.key = edge;\n\n graph.emit('edgeAdded', eventData);\n\n return [edge, true, sourceWasAdded, targetWasAdded];\n}\n\n/**\n * Internal method used to drop an edge.\n *\n * @param {Graph} graph - Target graph.\n * @param {EdgeData} edgeData - Data of the edge to drop.\n */\nfunction dropEdgeFromData(graph, edgeData) {\n // Dropping the edge from the register\n graph._edges.delete(edgeData.key);\n\n // Updating related degrees\n const {source: sourceData, target: targetData, attributes} = edgeData;\n\n const undirected = edgeData.undirected;\n\n const isSelfLoop = sourceData === targetData;\n\n if (undirected) {\n sourceData.undirectedDegree--;\n targetData.undirectedDegree--;\n\n if (isSelfLoop) {\n sourceData.undirectedLoops--;\n graph._undirectedSelfLoopCount--;\n }\n } else {\n sourceData.outDegree--;\n targetData.inDegree--;\n\n if (isSelfLoop) {\n sourceData.directedLoops--;\n graph._directedSelfLoopCount--;\n }\n }\n\n // Clearing index\n if (graph.multi) edgeData.detachMulti();\n else edgeData.detach();\n\n if (undirected) graph._undirectedSize--;\n else graph._directedSize--;\n\n // Emitting\n graph.emit('edgeDropped', {\n key: edgeData.key,\n attributes,\n source: sourceData.key,\n target: targetData.key,\n undirected\n });\n}\n\n/**\n * Graph class\n *\n * @constructor\n * @param {object} [options] - Options:\n * @param {boolean} [allowSelfLoops] - Allow self loops?\n * @param {string} [type] - Type of the graph.\n * @param {boolean} [map] - Allow references as keys?\n * @param {boolean} [multi] - Allow parallel edges?\n *\n * @throws {Error} - Will throw if the arguments are not valid.\n */\nexport default class Graph extends EventEmitter {\n constructor(options) {\n super();\n\n //-- Solving options\n options = assign({}, DEFAULTS, options);\n\n // Enforcing options validity\n if (typeof options.multi !== 'boolean')\n throw new InvalidArgumentsGraphError(\n `Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"${options.multi}\".`\n );\n\n if (!TYPES.has(options.type))\n throw new InvalidArgumentsGraphError(\n `Graph.constructor: invalid 'type' option. Should be one of \"mixed\", \"directed\" or \"undirected\" but got \"${options.type}\".`\n );\n\n if (typeof options.allowSelfLoops !== 'boolean')\n throw new InvalidArgumentsGraphError(\n `Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"${options.allowSelfLoops}\".`\n );\n\n //-- Private properties\n\n // Utilities\n const NodeDataClass =\n options.type === 'mixed'\n ? MixedNodeData\n : options.type === 'directed'\n ? DirectedNodeData\n : UndirectedNodeData;\n\n privateProperty(this, 'NodeDataClass', NodeDataClass);\n\n // Internal edge key generator\n\n // NOTE: this internal generator produce keys that are strings\n // composed of a weird prefix, an incremental instance id starting from\n // a random byte and finally an internal instance incremental id.\n // All this to avoid intra-frame and cross-frame adversarial inputs\n // that can force a single #.addEdge call to degenerate into a O(n)\n // available key search loop.\n\n // It also ensures that automatically generated edge keys are unlikely\n // to produce collisions with arbitrary keys given by users.\n const instancePrefix = 'geid_' + INSTANCE_ID() + '_';\n let edgeId = 0;\n\n const edgeKeyGenerator = () => {\n let availableEdgeKey;\n\n do {\n availableEdgeKey = instancePrefix + edgeId++;\n } while (this._edges.has(availableEdgeKey));\n\n return availableEdgeKey;\n };\n\n // Indexes\n privateProperty(this, '_attributes', {});\n privateProperty(this, '_nodes', new Map());\n privateProperty(this, '_edges', new Map());\n privateProperty(this, '_directedSize', 0);\n privateProperty(this, '_undirectedSize', 0);\n privateProperty(this, '_directedSelfLoopCount', 0);\n privateProperty(this, '_undirectedSelfLoopCount', 0);\n privateProperty(this, '_edgeKeyGenerator', edgeKeyGenerator);\n\n // Options\n privateProperty(this, '_options', options);\n\n // Emitter properties\n EMITTER_PROPS.forEach(prop => privateProperty(this, prop, this[prop]));\n\n //-- Properties readers\n readOnlyProperty(this, 'order', () => this._nodes.size);\n readOnlyProperty(this, 'size', () => this._edges.size);\n readOnlyProperty(this, 'directedSize', () => this._directedSize);\n readOnlyProperty(this, 'undirectedSize', () => this._undirectedSize);\n readOnlyProperty(\n this,\n 'selfLoopCount',\n () => this._directedSelfLoopCount + this._undirectedSelfLoopCount\n );\n readOnlyProperty(\n this,\n 'directedSelfLoopCount',\n () => this._directedSelfLoopCount\n );\n readOnlyProperty(\n this,\n 'undirectedSelfLoopCount',\n () => this._undirectedSelfLoopCount\n );\n readOnlyProperty(this, 'multi', this._options.multi);\n readOnlyProperty(this, 'type', this._options.type);\n readOnlyProperty(this, 'allowSelfLoops', this._options.allowSelfLoops);\n readOnlyProperty(this, 'implementation', () => 'graphology');\n }\n\n _resetInstanceCounters() {\n this._directedSize = 0;\n this._undirectedSize = 0;\n this._directedSelfLoopCount = 0;\n this._undirectedSelfLoopCount = 0;\n }\n\n /**---------------------------------------------------------------------------\n * Read\n **---------------------------------------------------------------------------\n */\n\n /**\n * Method returning whether the given node is found in the graph.\n *\n * @param {any} node - The node.\n * @return {boolean}\n */\n hasNode(node) {\n return this._nodes.has('' + node);\n }\n\n /**\n * Method returning whether the given directed edge is found in the graph.\n *\n * Arity 1:\n * @param {any} edge - The edge's key.\n *\n * Arity 2:\n * @param {any} source - The edge's source.\n * @param {any} target - The edge's target.\n *\n * @return {boolean}\n *\n * @throws {Error} - Will throw if the arguments are invalid.\n */\n hasDirectedEdge(source, target) {\n // Early termination\n if (this.type === 'undirected') return false;\n\n if (arguments.length === 1) {\n const edge = '' + source;\n\n const edgeData = this._edges.get(edge);\n\n return !!edgeData && !edgeData.undirected;\n } else if (arguments.length === 2) {\n source = '' + source;\n target = '' + target;\n\n // If the node source or the target is not in the graph we break\n const nodeData = this._nodes.get(source);\n\n if (!nodeData) return false;\n\n // Is there a directed edge pointing toward target?\n return nodeData.out.hasOwnProperty(target);\n }\n\n throw new InvalidArgumentsGraphError(\n `Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`\n );\n }\n\n /**\n * Method returning whether the given undirected edge is found in the graph.\n *\n * Arity 1:\n * @param {any} edge - The edge's key.\n *\n * Arity 2:\n * @param {any} source - The edge's source.\n * @param {any} target - The edge's target.\n *\n * @return {boolean}\n *\n * @throws {Error} - Will throw if the arguments are invalid.\n */\n hasUndirectedEdge(source, target) {\n // Early termination\n if (this.type === 'directed') return false;\n\n if (arguments.length === 1) {\n const edge = '' + source;\n\n const edgeData = this._edges.get(edge);\n\n return !!edgeData && edgeData.undirected;\n } else if (arguments.length === 2) {\n source = '' + source;\n target = '' + target;\n\n // If the node source or the target is not in the graph we break\n const nodeData = this._nodes.get(source);\n\n if (!nodeData) return false;\n\n // Is there a directed edge pointing toward target?\n return nodeData.undirected.hasOwnProperty(target);\n }\n\n throw new InvalidArgumentsGraphError(\n `Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`\n );\n }\n\n /**\n * Method returning whether the given edge is found in the graph.\n *\n * Arity 1:\n * @param {any} edge - The edge's key.\n *\n * Arity 2:\n * @param {any} source - The edge's source.\n * @param {any} target - The edge's target.\n *\n * @return {boolean}\n *\n * @throws {Error} - Will throw if the arguments are invalid.\n */\n hasEdge(source, target) {\n if (arguments.length === 1) {\n const edge = '' + source;\n\n return this._edges.has(edge);\n } else if (arguments.length === 2) {\n source = '' + source;\n target = '' + target;\n\n // If the node source or the target is not in the graph we break\n const nodeData = this._nodes.get(source);\n\n if (!nodeData) return false;\n\n // Is there a directed edge pointing toward target?\n return (\n (typeof nodeData.out !== 'undefined' &&\n nodeData.out.hasOwnProperty(target)) ||\n (typeof nodeData.undirected !== 'undefined' &&\n nodeData.undirected.hasOwnProperty(target))\n );\n }\n\n throw new InvalidArgumentsGraphError(\n `Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`\n );\n }\n\n /**\n * Method returning the edge matching source & target in a directed fashion.\n *\n * @param {any} source - The edge's source.\n * @param {any} target - The edge's target.\n *\n * @return {any|undefined}\n *\n * @throws {Error} - Will throw if the graph is multi.\n * @throws {Error} - Will throw if source or target doesn't exist.\n */\n directedEdge(source, target) {\n if (this.type === 'undirected') return;\n\n source = '' + source;\n target = '' + target;\n\n if (this.multi)\n throw new UsageGraphError(\n 'Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.'\n );\n\n const sourceData = this._nodes.get(source);\n\n if (!sourceData)\n throw new NotFoundGraphError(\n `Graph.directedEdge: could not find the \"${source}\" source node in the graph.`\n );\n\n if (!this._nodes.has(target))\n throw new NotFoundGraphError(\n `Graph.directedEdge: could not find the \"${target}\" target node in the graph.`\n );\n\n const edgeData = (sourceData.out && sourceData.out[target]) || undefined;\n\n if (edgeData) return edgeData.key;\n }\n\n /**\n * Method returning the edge matching source & target in a undirected fashion.\n *\n * @param {any} source - The edge's source.\n * @param {any} target - The edge's target.\n *\n * @return {any|undefined}\n *\n * @throws {Error} - Will throw if the graph is multi.\n * @throws {Error} - Will throw if source or target doesn't exist.\n */\n undirectedEdge(source, target) {\n if (this.type === 'directed') return;\n\n source = '' + source;\n target = '' + target;\n\n if (this.multi)\n throw new UsageGraphError(\n 'Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.'\n );\n\n const sourceData = this._nodes.get(source);\n\n if (!sourceData)\n throw new NotFoundGraphError(\n `Graph.undirectedEdge: could not find the \"${source}\" source node in the graph.`\n );\n\n if (!this._nodes.has(target))\n throw new NotFoundGraphError(\n `Graph.undirectedEdge: could not find the \"${target}\" target node in the graph.`\n );\n\n const edgeData =\n (sourceData.undirected && sourceData.undirected[target]) || undefined;\n\n if (edgeData) return edgeData.key;\n }\n\n /**\n * Method returning the edge matching source & target in a mixed fashion.\n *\n * @param {any} source - The edge's source.\n * @param {any} target - The edge's target.\n *\n * @return {any|undefined}\n *\n * @throws {Error} - Will throw if the graph is multi.\n * @throws {Error} - Will throw if source or target doesn't exist.\n */\n edge(source, target) {\n if (this.multi)\n throw new UsageGraphError(\n 'Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.'\n );\n\n source = '' + source;\n target = '' + target;\n\n const sourceData = this._nodes.get(source);\n\n if (!sourceData)\n throw new NotFoundGraphError(\n `Graph.edge: could not find the \"${source}\" source node in the graph.`\n );\n\n if (!this._nodes.has(target))\n throw new NotFoundGraphError(\n `Graph.edge: could not find the \"${target}\" target node in the graph.`\n );\n\n const edgeData =\n (sourceData.out && sourceData.out[target]) ||\n (sourceData.undirected && sourceData.undirected[target]) ||\n undefined;\n\n if (edgeData) return edgeData.key;\n }\n\n /**\n * Method returning whether two nodes are directed neighbors.\n *\n * @param {any} node - The node's key.\n * @param {any} neighbor - The neighbor's key.\n * @return {boolean}\n *\n * @throws {Error} - Will throw if the node isn't in the graph.\n */\n areDirectedNeighbors(node, neighbor) {\n node = '' + node;\n neighbor = '' + neighbor;\n\n const nodeData = this._nodes.get(node);\n\n if (!nodeData)\n throw new NotFoundGraphError(\n `Graph.areDirectedNeighbors: could not find the \"${node}\" node in the graph.`\n );\n\n if (this.type === 'undirected') return false;\n\n return neighbor in nodeData.in || neighbor in nodeData.out;\n }\n\n /**\n * Method returning whether two nodes are out neighbors.\n *\n * @param {any} node - The node's key.\n * @param {any} neighbor - The neighbor's key.\n * @return {boolean}\n *\n * @throws {Error} - Will throw if the node isn't in the graph.\n */\n areOutNeighbors(node, neighbor) {\n node = '' + node;\n neighbor = '' + neighbor;\n\n const nodeData = this._nodes.get(node);\n\n if (!nodeData)\n throw new NotFoundGraphError(\n `Graph.areOutNeighbors: could not find the \"${node}\" node in the graph.`\n );\n\n if (this.type === 'undirected') return false;\n\n return neighbor in nodeData.out;\n }\n\n /**\n * Method returning whether two nodes are in neighbors.\n *\n * @param {any} node - The node's key.\n * @param {any} neighbor - The neighbor's key.\n * @return {boolean}\n *\n * @throws {Error} - Will throw if the node isn't in the graph.\n */\n areInNeighbors(node, neighbor) {\n node = '' + node;\n neighbor = '' + neighbor;\n\n const nodeData = this._nodes.get(node);\n\n if (!nodeData)\n throw new NotFoundGraphError(\n `Graph.areInNeighbors: could not find the \"${node}\" node in the graph.`\n );\n\n if (this.type === 'undirected') return false;\n\n return neighbor in nodeData.in;\n }\n\n /**\n * Method returning whether two nodes are undirected neighbors.\n *\n * @param {any} node - The node's key.\n * @param {any} neighbor - The neighbor's key.\n * @return {boolean}\n *\n * @throws {Error} - Will throw if the node isn't in the graph.\n */\n areUndirectedNeighbors(node, neighbor) {\n node = '' + node;\n neighbor = '' + neighbor;\n\n const nodeData = this._nodes.get(node);\n\n if (!nodeData)\n throw new NotFoundGraphError(\n `Graph.areUndirectedNeighbors: could not find the \"${node}\" node in the graph.`\n );\n\n if (this.type === 'directed') return false;\n\n return neighbor in nodeData.undirected;\n }\n\n /**\n * Method returning whether two nodes are neighbors.\n *\n * @param {any} node - The node's key.\n * @param {any} neighbor - The neighbor's key.\n * @return {boolean}\n *\n * @throws {Error} - Will throw if the node isn't in the graph.\n */\n areNeighbors(node, neighbor) {\n node = '' + node;\n neighbor = '' + neighbor;\n\n const nodeData = this._nodes.get(node);\n\n if (!nodeData)\n throw new NotFoundGraphError(\n `Graph.areNeighbors: could not find the \"${node}\" node in the graph.`\n );\n\n if (this.type !== 'undirected') {\n if (neighbor in nodeData.in || neighbor in nodeData.out) return true;\n }\n\n if (this.type !== 'directed') {\n if (neighbor in nodeData.undirected) return true;\n }\n\n return false;\n }\n\n /**\n * Method returning whether two nodes are inbound neighbors.\n *\n * @param {any} node - The node's key.\n * @param {any} neighbor - The neighbor's key.\n * @return {boolean}\n *\n * @throws {Error} - Will throw if the node isn't in the graph.\n */\n areInboundNeighbors(node, neighbor) {\n node = '' + node;\n neighbor = '' + neighbor;\n\n const nodeData = this._nodes.get(node);\n\n if (!nodeData)\n throw new NotFoundGraphError(\n `Graph.areInboundNeighbors: could not find the \"${node}\" node in the graph.`\n );\n\n if (this.type !== 'undirected') {\n if (neighbor in nodeData.in) return true;\n }\n\n if (this.type !== 'directed') {\n if (neighbor in nodeData.undirected) return true;\n }\n\n return false;\n }\n\n /**\n * Method returning whether two nodes are outbound neighbors.\n *\n * @param {any} node - The node's key.\n * @param {any} neighbor - The neighbor's key.\n * @return {boolean}\n *\n * @throws {Error} - Will throw if the node isn't in the graph.\n */\n areOutboundNeighbors(node, neighbor) {\n node = '' + node;\n neighbor = '' + neighbor;\n\n const nodeData = this._nodes.get(node);\n\n if (!nodeData)\n throw new NotFoundGraphError(\n `Graph.areOutboundNeighbors: could not find the \"${node}\" node in the graph.`\n );\n\n if (this.type !== 'undirected') {\n if (neighbor in nodeData.out) return true;\n }\n\n if (this.type !== 'directed') {\n if (neighbor in nodeData.undirected) return true;\n }\n\n return false;\n }\n\n /**\n * Method returning the given node's in degree.\n *\n * @param {any} node - The node's key.\n * @return {number} - The node's in degree.\n *\n * @throws {Error} - Will throw if the node isn't in the graph.\n */\n inDegree(node) {\n node = '' + node;\n\n const nodeData = this._nodes.get(node);\n\n if (!nodeData)\n throw new NotFoundGraphError(\n `Graph.inDegree: could not find the \"${node}\" node in the graph.`\n );\n\n if (this.type === 'undirected') return 0;\n\n return nodeData.inDegree;\n }\n\n /**\n * Method returning the given node's out degree.\n *\n * @param {any} node - The node's key.\n * @return {number} - The node's in degree.\n *\n * @throws {Error} - Will throw if the node isn't in the graph.\n */\n outDegree(node) {\n node = '' + node;\n\n const nodeData = this._nodes.get(node);\n\n if (!nodeData)\n throw new NotFoundGraphError(\n `Graph.outDegree: could not find the \"${node}\" node in the graph.`\n );\n\n if (this.type === 'undirected') return 0;\n\n return nodeData.outDegree;\n }\n\n /**\n * Method returning the given node's directed degree.\n *\n * @param {any} node - The node's key.\n * @return {number} - The node's in degree.\n *\n * @throws {Error} - Will throw if the node isn't in the graph.\n */\n directedDegree(node) {\n node = '' + node;\n\n const nodeData = this._nodes.get(node);\n\n if (!nodeData)\n throw new NotFoundGraphError(\n `Graph.directedDegree: could not find the \"${node}\" node in the graph.`\n );\n\n if (this.type === 'undirected') return 0;\n\n return nodeData.inDegree + nodeData.outDegree;\n }\n\n /**\n * Method returning the given node's undirected degree.\n *\n * @param {any} node - The node's key.\n * @return {number} - The node's in degree.\n *\n * @throws {Error} - Will throw if the node isn't in the graph.\n */\n undirectedDegree(node) {\n node = '' + node;\n\n const nodeData = this._nodes.get(node);\n\n if (!nodeData)\n throw new NotFoundGraphError(\n `Graph.undirectedDegree: could not find the \"${node}\" node in the graph.`\n );\n\n if (this.type === 'directed') return 0;\n\n return nodeData.undirectedDegree;\n }\n\n /**\n * Method returning the given node's inbound degree.\n *\n * @param {any} node - The node's key.\n * @return {number} - The node's inbound degree.\n *\n * @throws {Error} - Will throw if the node isn't in the graph.\n */\n inboundDegree(node) {\n node = '' + node;\n\n const nodeData = this._nodes.get(node);\n\n if (!nodeData)\n throw new NotFoundGraphError(\n `Graph.inboundDegree: could not find the \"${node}\" node in the graph.`\n );\n\n let degree = 0;\n\n if (this.type !== 'directed') {\n degree += nodeData.undirectedDegree;\n }\n\n if (this.type !== 'undirected') {\n degree += nodeData.inDegree;\n }\n\n return degree;\n }\n\n /**\n * Method returning the given node's outbound degree.\n *\n * @param {any} node - The node's key.\n * @return {number} - The node's outbound degree.\n *\n * @throws {Error} - Will throw if the node isn't in the graph.\n */\n outboundDegree(node) {\n node = '' + node;\n\n const nodeData = this._nodes.get(node);\n\n if (!nodeData)\n throw new NotFoundGraphError(\n `Graph.outboundDegree: could not find the \"${node}\" node in the graph.`\n );\n\n let degree = 0;\n\n if (this.type !== 'directed') {\n degree += nodeData.undirectedDegree;\n }\n\n if (this.type !== 'undirected') {\n degree += nodeData.outDegree;\n }\n\n return degree;\n }\n\n /**\n * Method returning the given node's directed degree.\n *\n * @param {any} node - The node's key.\n * @return {number} - The node's degree.\n *\n * @throws {Error} - Will throw if the node isn't in the graph.\n */\n degree(node) {\n node = '' + node;\n\n const nodeData = this._nodes.get(node);\n\n if (!nodeData)\n throw new NotFoundGraphError(\n `Graph.degree: could not find the \"${node}\" node in the graph.`\n );\n\n let degree = 0;\n\n if (this.type !== 'directed') {\n degree += nodeData.undirectedDegree;\n }\n\n if (this.type !== 'undirected') {\n degree += nodeData.inDegree + nodeData.outDegree;\n }\n\n return degree;\n }\n\n /**\n * Method returning the given node's in degree without considering self loops.\n *\n * @param {any} node - The node's key.\n * @return {number} - The node's in degree.\n *\n * @throws {Error} - Will throw if the node isn't in the graph.\n */\n inDegreeWithoutSelfLoops(node) {\n node = '' + node;\n\n const nodeData = this._nodes.get(node);\n\n if (!nodeData)\n throw new NotFoundGraphError(\n `Graph.inDegreeWithoutSelfLoops: could not find the \"${node}\" node in the graph.`\n );\n\n if (this.type === 'undirected') return 0;\n\n return nodeData.inDegree - nodeData.directedLoops;\n }\n\n /**\n * Method returning the given node's out degree without considering self loops.\n *\n * @param {any} node - The node's key.\n * @return {number} - The node's in degree.\n *\n * @throws {Error} - Will throw if the node isn't in the graph.\n */\n outDegreeWithoutSelfLoops(node) {\n node = '' + node;\n\n const nodeData = this._nodes.get(node);\n\n if (!nodeData)\n throw new NotFoundGraphError(\n `Graph.outDegreeWithoutSelfLoops: could not find the \"${node}\" node in the graph.`\n );\n\n if (this.type === 'undirected') return 0;\n\n return nodeData.outDegree - nodeData.directedLoops;\n }\n\n /**\n * Method returning the given node's directed degree without considering self loops.\n *\n * @param {any} node - The node's key.\n * @return {number} - The node's in degree.\n *\n * @throws {Error} - Will throw if the node isn't in the graph.\n */\n directedDegreeWithoutSelfLoops(node) {\n node = '' + node;\n\n const nodeData = this._nodes.get(node);\n\n if (!nodeData)\n throw new NotFoundGraphError(\n `Graph.directedDegreeWithoutSelfLoops: could not find the \"${node}\" node in the graph.`\n );\n\n if (this.type === 'undirected') return 0;\n\n return nodeData.inDegree + nodeData.outDegree - nodeData.directedLoops * 2;\n }\n\n /**\n * Method returning the given node's undirected degree without considering self loops.\n *\n * @param {any} node - The node's key.\n * @return {number} - The node's in degree.\n *\n * @throws {Error} - Will throw if the node isn't in the graph.\n */\n undirectedDegreeWithoutSelfLoops(node) {\n node = '' + node;\n\n const nodeData = this._nodes.get(node);\n\n if (!nodeData)\n throw new NotFoundGraphError(\n `Graph.undirectedDegreeWithoutSelfLoops: could not find the \"${node}\" node in the graph.`\n );\n\n if (this.type === 'directed') return 0;\n\n return nodeData.undirectedDegree - nodeData.undirectedLoops * 2;\n }\n\n /**\n * Method returning the given node's inbound degree without considering self loops.\n *\n * @param {any} node - The node's key.\n * @return {number} - The node's inbound degree.\n *\n * @throws {Error} - Will throw if the node isn't in the graph.\n */\n inboundDegreeWithoutSelfLoops(node) {\n node = '' + node;\n\n const nodeData = this._nodes.get(node);\n\n if (!nodeData)\n throw new NotFoundGraphError(\n `Graph.inboundDegreeWithoutSelfLoops: could not find the \"${node}\" node in the graph.`\n );\n\n let degree = 0;\n let loops = 0;\n\n if (this.type !== 'directed') {\n degree += nodeData.undirectedDegree;\n loops += nodeData.undirectedLoops * 2;\n }\n\n if (this.type !== 'undirected') {\n degree += nodeData.inDegree;\n loops += nodeData.directedLoops;\n }\n\n return degree - loops;\n }\n\n /**\n * Method returning the given node's outbound degree without considering self loops.\n *\n * @param {any} node - The node's key.\n * @return {number} - The node's outbound degree.\n *\n * @throws {Error} - Will throw if the node isn't in the graph.\n */\n outboundDegreeWithoutSelfLoops(node) {\n node = '' + node;\n\n const nodeData = this._nodes.get(node);\n\n if (!nodeData)\n throw new NotFoundGraphError(\n `Graph.outboundDegreeWithoutSelfLoops: could not find the \"${node}\" node in the graph.`\n );\n\n let degree = 0;\n let loops = 0;\n\n if (this.type !== 'directed') {\n degree += nodeData.undirectedDegree;\n loops += nodeData.undirectedLoops * 2;\n }\n\n if (this.type !== 'undirected') {\n degree += nodeData.outDegree;\n loops += nodeData.directedLoops;\n }\n\n return degree - loops;\n }\n\n /**\n * Method returning the given node's directed degree without considering self loops.\n *\n * @param {any} node - The node's key.\n * @return {number} - The node's degree.\n *\n * @throws {Error} - Will throw if the node isn't in the graph.\n */\n degreeWithoutSelfLoops(node) {\n node = '' + node;\n\n const nodeData = this._nodes.get(node);\n\n if (!nodeData)\n throw new NotFoundGraphError(\n `Graph.degreeWithoutSelfLoops: could not find the \"${node}\" node in the graph.`\n );\n\n let degree = 0;\n let loops = 0;\n\n if (this.type !== 'directed') {\n degree += nodeData.undirectedDegree;\n loops += nodeData.undirectedLoops * 2;\n }\n\n if (this.type !== 'undirected') {\n degree += nodeData.inDegree + nodeData.outDegree;\n loops += nodeData.directedLoops * 2;\n }\n\n return degree - loops;\n }\n\n /**\n * Method returning the given edge's source.\n *\n * @param {any} edge - The edge's key.\n * @return {any} - The edge's source.\n *\n * @throws {Error} - Will throw if the edge isn't in the graph.\n */\n source(edge) {\n edge = '' + edge;\n\n const data = this._edges.get(edge);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.source: could not find the \"${edge}\" edge in the graph.`\n );\n\n return data.source.key;\n }\n\n /**\n * Method returning the given edge's target.\n *\n * @param {any} edge - The edge's key.\n * @return {any} - The edge's target.\n *\n * @throws {Error} - Will throw if the edge isn't in the graph.\n */\n target(edge) {\n edge = '' + edge;\n\n const data = this._edges.get(edge);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.target: could not find the \"${edge}\" edge in the graph.`\n );\n\n return data.target.key;\n }\n\n /**\n * Method returning the given edge's extremities.\n *\n * @param {any} edge - The edge's key.\n * @return {array} - The edge's extremities.\n *\n * @throws {Error} - Will throw if the edge isn't in the graph.\n */\n extremities(edge) {\n edge = '' + edge;\n\n const edgeData = this._edges.get(edge);\n\n if (!edgeData)\n throw new NotFoundGraphError(\n `Graph.extremities: could not find the \"${edge}\" edge in the graph.`\n );\n\n return [edgeData.source.key, edgeData.target.key];\n }\n\n /**\n * Given a node & an edge, returns the other extremity of the edge.\n *\n * @param {any} node - The node's key.\n * @param {any} edge - The edge's key.\n * @return {any} - The related node.\n *\n * @throws {Error} - Will throw if the edge isn't in the graph or if the\n * edge & node are not related.\n */\n opposite(node, edge) {\n node = '' + node;\n edge = '' + edge;\n\n const data = this._edges.get(edge);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.opposite: could not find the \"${edge}\" edge in the graph.`\n );\n\n const source = data.source.key;\n const target = data.target.key;\n\n if (node === source) return target;\n if (node === target) return source;\n\n throw new NotFoundGraphError(\n `Graph.opposite: the \"${node}\" node is not attached to the \"${edge}\" edge (${source}, ${target}).`\n );\n }\n\n /**\n * Returns whether the given edge has the given node as extremity.\n *\n * @param {any} edge - The edge's key.\n * @param {any} node - The node's key.\n * @return {boolean} - The related node.\n *\n * @throws {Error} - Will throw if either the node or the edge isn't in the graph.\n */\n hasExtremity(edge, node) {\n edge = '' + edge;\n node = '' + node;\n\n const data = this._edges.get(edge);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.hasExtremity: could not find the \"${edge}\" edge in the graph.`\n );\n\n return data.source.key === node || data.target.key === node;\n }\n\n /**\n * Method returning whether the given edge is undirected.\n *\n * @param {any} edge - The edge's key.\n * @return {boolean}\n *\n * @throws {Error} - Will throw if the edge isn't in the graph.\n */\n isUndirected(edge) {\n edge = '' + edge;\n\n const data = this._edges.get(edge);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.isUndirected: could not find the \"${edge}\" edge in the graph.`\n );\n\n return data.undirected;\n }\n\n /**\n * Method returning whether the given edge is directed.\n *\n * @param {any} edge - The edge's key.\n * @return {boolean}\n *\n * @throws {Error} - Will throw if the edge isn't in the graph.\n */\n isDirected(edge) {\n edge = '' + edge;\n\n const data = this._edges.get(edge);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.isDirected: could not find the \"${edge}\" edge in the graph.`\n );\n\n return !data.undirected;\n }\n\n /**\n * Method returning whether the given edge is a self loop.\n *\n * @param {any} edge - The edge's key.\n * @return {boolean}\n *\n * @throws {Error} - Will throw if the edge isn't in the graph.\n */\n isSelfLoop(edge) {\n edge = '' + edge;\n\n const data = this._edges.get(edge);\n\n if (!data)\n throw new NotFoundGraphError(\n `Graph.isSelfLoop: could not find the \"${edge}\" edge in the graph.`\n );\n\n return data.source === data.target;\n }\n\n /**---------------------------------------------------------------------------\n * Mutation\n **---------------------------------------------------------------------------\n */\n\n /**\n * Method used to add a node to the graph.\n *\n * @param {any} node - The node.\n * @param {object} [attributes] - Optional attributes.\n * @return {any} - The node.\n *\n * @throws {Error} - Will throw if the given node already exist.\n * @throws {Error} - Will throw if the given attributes are not an object.\n */\n addNode(node, attributes) {\n const nodeData = addNode(this, node, attributes);\n\n return nodeData.key;\n }\n\n /**\n * Method used to merge a node into the graph.\n *\n * @param {any} node - The node.\n * @param {object} [attributes] - Optional attributes.\n * @return {any} - The node.\n */\n mergeNode(node, attributes) {\n if (attributes && !isPlainObject(attributes))\n throw new InvalidArgumentsGraphError(\n `Graph.mergeNode: invalid attributes. Expecting an object but got \"${attributes}\"`\n );\n\n // String coercion\n node = '' + node;\n attributes = attributes || {};\n\n // If the node already exists, we merge the attributes\n let data = this._nodes.get(node);\n\n if (data) {\n if (attributes) {\n assign(data.attributes, attributes);\n\n this.emit('nodeAttributesUpdated', {\n type: 'merge',\n key: node,\n attributes: data.attributes,\n data: attributes\n });\n }\n return [node, false];\n }\n\n data = new this.NodeDataClass(node, attributes);\n\n // Adding the node to internal register\n this._nodes.set(node, data);\n\n // Emitting\n this.emit('nodeAdded', {\n key: node,\n attributes\n });\n\n return [node, true];\n }\n\n /**\n * Method used to add a node if it does not exist in the graph or else to\n * update its attributes using a function.\n *\n * @param {any} node - The node.\n * @param {function} [updater] - Optional updater function.\n * @return {any} - The node.\n */\n updateNode(node, updater) {\n if (updater && typeof updater !== 'function')\n throw new InvalidArgumentsGraphError(\n `Graph.updateNode: invalid updater function. Expecting a function but got \"${updater}\"`\n );\n\n // String coercion\n node = '' + node;\n\n // If the node already exists, we update the attributes\n let data = this._nodes.get(node);\n\n if (data) {\n if (updater) {\n const oldAttributes = data.attributes;\n data.attributes = updater(oldAttributes);\n\n this.emit('nodeAttributesUpdated', {\n type: 'replace',\n key: node,\n attributes: data.attributes\n });\n }\n return [node, false];\n }\n\n const attributes = updater ? updater({}) : {};\n\n data = new this.NodeDataClass(node, attributes);\n\n // Adding the node to internal register\n this._nodes.set(node, data);\n\n // Emitting\n this.emit('nodeAdded', {\n key: node,\n attributes\n });\n\n return [node, true];\n }\n\n /**\n * Method used to drop a single node & all its attached edges from the graph.\n *\n * @param {any} node - The node.\n * @return {Graph}\n *\n * @throws {Error} - Will throw if the node doesn't exist.\n */\n dropNode(node) {\n node = '' + node;\n\n const nodeData = this._nodes.get(node);\n\n if (!nodeData)\n throw new NotFoundGraphError(\n `Graph.dropNode: could not find the \"${node}\" node in the graph.`\n );\n\n let edgeData;\n\n // Removing attached edges\n // NOTE: we could be faster here, but this is such a pain to maintain\n if (this.type !== 'undirected') {\n for (const neighbor in nodeData.out) {\n edgeData = nodeData.out[neighbor];\n\n do {\n dropEdgeFromData(this, edgeData);\n edgeData = edgeData.next;\n } while (edgeData);\n }\n\n for (const neighbor in nodeData.in) {\n edgeData = nodeData.in[neighbor];\n\n do {\n dropEdgeFromData(this, edgeData);\n edgeData = edgeData.next;\n } while (edgeData);\n }\n }\n\n if (this.type !== 'directed') {\n for (const neighbor in nodeData.undirected) {\n edgeData = nodeData.undirected[neighbor];\n\n do {\n dropEdgeFromData(this, edgeData);\n edgeData = edgeData.next;\n } while (edgeData);\n }\n }\n\n // Dropping the node from the register\n this._nodes.delete(node);\n\n // Emitting\n this.emit('nodeDropped', {\n key: node,\n attributes: nodeData.attributes\n });\n }\n\n /**\n * Method used to drop a single edge from the graph.\n *\n * Arity 1:\n * @param {any} edge - The edge.\n *\n * Arity 2:\n * @param {any} source - Source node.\n * @param {any} target - Target node.\n *\n * @return {Graph}\n *\n * @throws {Error} - Will throw if the edge doesn't exist.\n */\n dropEdge(edge) {\n let edgeData;\n\n if (arguments.length > 1) {\n const source = '' + arguments[0];\n const target = '' + arguments[1];\n\n edgeData = getMatchingEdge(this, source, target, this.type);\n\n if (!edgeData)\n throw new NotFoundGraphError(\n `Graph.dropEdge: could not find the \"${source}\" -> \"${target}\" edge in the graph.`\n );\n } else {\n edge = '' + edge;\n\n edgeData = this._edges.get(edge);\n\n if (!edgeData)\n throw new NotFoundGraphError(\n `Graph.dropEdge: could not find the \"${edge}\" edge in the graph.`\n );\n }\n\n dropEdgeFromData(this, edgeData);\n\n return this;\n }\n\n /**\n * Method used to drop a single directed edge from the graph.\n *\n * @param {any} source - Source node.\n * @param {any} target - Target node.\n *\n * @return {Graph}\n *\n * @throws {Error} - Will throw if the edge doesn't exist.\n */\n dropDirectedEdge(source, target) {\n if (arguments.length < 2)\n throw new UsageGraphError(\n 'Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.'\n );\n\n if (this.multi)\n throw new UsageGraphError(\n 'Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.'\n );\n\n source = '' + source;\n target = '' + target;\n\n const edgeData = getMatchingEdge(this, source, target, 'directed');\n\n if (!edgeData)\n throw new NotFoundGraphError(\n `Graph.dropDirectedEdge: could not find a \"${source}\" -> \"${target}\" edge in the graph.`\n );\n\n dropEdgeFromData(this, edgeData);\n\n return this;\n }\n\n /**\n * Method used to drop a single undirected edge from the graph.\n *\n * @param {any} source - Source node.\n * @param {any} target - Target node.\n *\n * @return {Graph}\n *\n * @throws {Error} - Will throw if the edge doesn't exist.\n */\n dropUndirectedEdge(source, target) {\n if (arguments.length < 2)\n throw new UsageGraphError(\n 'Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.'\n );\n\n if (this.multi)\n throw new UsageGraphError(\n 'Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.'\n );\n\n const edgeData = getMatchingEdge(this, source, target, 'undirected');\n\n if (!edgeData)\n throw new NotFoundGraphError(\n `Graph.dropUndirectedEdge: could not find a \"${source}\" -> \"${target}\" edge in the graph.`\n );\n\n dropEdgeFromData(this, edgeData);\n\n return this;\n }\n\n /**\n * Method used to remove every edge & every node from the graph.\n *\n * @return {Graph}\n */\n clear() {\n // Clearing edges\n this._edges.clear();\n\n // Clearing nodes\n this._nodes.clear();\n\n // Reset counters\n this._resetInstanceCounters();\n\n // Emitting\n this.emit('cleared');\n }\n\n /**\n * Method used to remove every edge from the graph.\n *\n * @return {Graph}\n */\n clearEdges() {\n // Clearing structure index\n const iterator = this._nodes.values();\n\n let step;\n\n while (((step = iterator.next()), step.done !== true)) {\n step.value.clear();\n }\n\n // Clearing edges\n this._edges.clear();\n\n // Reset counters\n this._resetInstanceCounters();\n\n // Emitting\n this.emit('edgesCleared');\n }\n\n /**---------------------------------------------------------------------------\n * Attributes-related methods\n **---------------------------------------------------------------------------\n */\n\n /**\n * Method returning the desired graph's attribute.\n *\n * @param {string} name - Name of the attribute.\n * @return {any}\n */\n getAttribute(name) {\n return this._attributes[name];\n }\n\n /**\n * Method returning the graph's attributes.\n *\n * @return {object}\n */\n getAttributes() {\n return this._attributes;\n }\n\n /**\n * Method returning whether the graph has the desired attribute.\n *\n * @param {string} name - Name of the attribute.\n * @return {boolean}\n */\n hasAttribute(name) {\n return this._attributes.hasOwnProperty(name);\n }\n\n /**\n * Method setting a value for the desired graph's attribute.\n *\n * @param {string} name - Name of the attribute.\n * @param {any} value - Value for the attribute.\n * @return {Graph}\n */\n setAttribute(name, value) {\n this._attributes[name] = value;\n\n // Emitting\n this.emit('attributesUpdated', {\n type: 'set',\n attributes: this._attributes,\n name\n });\n\n return this;\n }\n\n /**\n * Method using a function to update the desired graph's attribute's value.\n *\n * @param {string} name - Name of the attribute.\n * @param {function} updater - Function use to update the attribute's value.\n * @return {Graph}\n */\n updateAttribute(name, updater) {\n if (typeof updater !== 'function')\n throw new InvalidArgumentsGraphError(\n 'Graph.updateAttribute: updater should be a function.'\n );\n\n const value = this._attributes[name];\n\n this._attributes[name] = updater(value);\n\n // Emitting\n this.emit('attributesUpdated', {\n type: 'set',\n attributes: this._attributes,\n name\n });\n\n return this;\n }\n\n /**\n * Method removing the desired graph's attribute.\n *\n * @param {string} name - Name of the attribute.\n * @return {Graph}\n */\n removeAttribute(name) {\n delete this._attributes[name];\n\n // Emitting\n this.emit('attributesUpdated', {\n type: 'remove',\n attributes: this._attributes,\n name\n });\n\n return this;\n }\n\n /**\n * Method replacing the graph's attributes.\n *\n * @param {object} attributes - New attributes.\n * @return {Graph}\n *\n * @throws {Error} - Will throw if given attributes are not a plain object.\n */\n replaceAttributes(attributes) {\n if (!isPlainObject(attributes))\n throw new InvalidArgumentsGraphError(\n 'Graph.replaceAttributes: provided attributes are not a plain object.'\n );\n\n this._attributes = attributes;\n\n // Emitting\n this.emit('attributesUpdated', {\n type: 'replace',\n attributes: this._attributes\n });\n\n return this;\n }\n\n /**\n * Method merging the graph's attributes.\n *\n * @param {object} attributes - Attributes to merge.\n * @return {Graph}\n *\n * @throws {Error} - Will throw if given attributes are not a plain object.\n */\n mergeAttributes(attributes) {\n if (!isPlainObject(attributes))\n throw new InvalidArgumentsGraphError(\n 'Graph.mergeAttributes: provided attributes are not a plain object.'\n );\n\n assign(this._attributes, attributes);\n\n // Emitting\n this.emit('attributesUpdated', {\n type: 'merge',\n attributes: this._attributes,\n data: attributes\n });\n\n return this;\n }\n\n /**\n * Method updating the graph's attributes.\n *\n * @param {function} updater - Function used to update the attributes.\n * @return {Graph}\n *\n * @throws {Error} - Will throw if given updater is not a function.\n */\n updateAttributes(updater) {\n if (typeof updater !== 'function')\n throw new InvalidArgumentsGraphError(\n 'Graph.updateAttributes: provided updater is not a function.'\n );\n\n this._attributes = updater(this._attributes);\n\n // Emitting\n this.emit('attributesUpdated', {\n type: 'update',\n attributes: this._attributes\n });\n\n return this;\n }\n\n /**\n * Method used to update each node's attributes using the given function.\n *\n * @param {function} updater - Updater function to use.\n * @param {object} [hints] - Optional hints.\n */\n updateEachNodeAttributes(updater, hints) {\n if (typeof updater !== 'function')\n throw new InvalidArgumentsGraphError(\n 'Graph.updateEachNodeAttributes: expecting an updater function.'\n );\n\n if (hints && !validateHints(hints))\n throw new InvalidArgumentsGraphError(\n 'Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}'\n );\n\n const iterator = this._nodes.values();\n\n let step, nodeData;\n\n while (((step = iterator.next()), step.done !== true)) {\n nodeData = step.value;\n nodeData.attributes = updater(nodeData.key, nodeData.attributes);\n }\n\n this.emit('eachNodeAttributesUpdated', {\n hints: hints ? hints : null\n });\n }\n\n /**\n * Method used to update each edge's attributes using the given function.\n *\n * @param {function} updater - Updater function to use.\n * @param {object} [hints] - Optional hints.\n */\n updateEachEdgeAttributes(updater, hints) {\n if (typeof updater !== 'function')\n throw new InvalidArgumentsGraphError(\n 'Graph.updateEachEdgeAttributes: expecting an updater function.'\n );\n\n if (hints && !validateHints(hints))\n throw new InvalidArgumentsGraphError(\n 'Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}'\n );\n\n const iterator = this._edges.values();\n\n let step, edgeData, sourceData, targetData;\n\n while (((step = iterator.next()), step.done !== true)) {\n edgeData = step.value;\n sourceData = edgeData.source;\n targetData = edgeData.target;\n\n edgeData.attributes = updater(\n edgeData.key,\n edgeData.attributes,\n sourceData.key,\n targetData.key,\n sourceData.attributes,\n targetData.attributes,\n edgeData.undirected\n );\n }\n\n this.emit('eachEdgeAttributesUpdated', {\n hints: hints ? hints : null\n });\n }\n\n /**---------------------------------------------------------------------------\n * Iteration-related methods\n **---------------------------------------------------------------------------\n */\n\n /**\n * Method iterating over the graph's adjacency using the given callback.\n *\n * @param {function} callback - Callback to use.\n */\n forEachAdjacencyEntry(callback) {\n if (typeof callback !== 'function')\n throw new InvalidArgumentsGraphError(\n 'Graph.forEachAdjacencyEntry: expecting a callback.'\n );\n\n forEachAdjacency(false, false, false, this, callback);\n }\n forEachAdjacencyEntryWithOrphans(callback) {\n if (typeof callback !== 'function')\n throw new InvalidArgumentsGraphError(\n 'Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.'\n );\n\n forEachAdjacency(false, false, true, this, callback);\n }\n\n /**\n * Method iterating over the graph's assymetric adjacency using the given callback.\n *\n * @param {function} callback - Callback to use.\n */\n forEachAssymetricAdjacencyEntry(callback) {\n if (typeof callback !== 'function')\n throw new InvalidArgumentsGraphError(\n 'Graph.forEachAssymetricAdjacencyEntry: expecting a callback.'\n );\n\n forEachAdjacency(false, true, false, this, callback);\n }\n forEachAssymetricAdjacencyEntryWithOrphans(callback) {\n if (typeof callback !== 'function')\n throw new InvalidArgumentsGraphError(\n 'Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.'\n );\n\n forEachAdjacency(false, true, true, this, callback);\n }\n\n /**\n * Method returning the list of the graph's nodes.\n *\n * @return {array} - The nodes.\n */\n nodes() {\n if (typeof Array.from === 'function') return Array.from(this._nodes.keys());\n\n return take(this._nodes.keys(), this._nodes.size);\n }\n\n /**\n * Method iterating over the graph's nodes using the given callback.\n *\n * @param {function} callback - Callback (key, attributes, index).\n */\n forEachNode(callback) {\n if (typeof callback !== 'function')\n throw new InvalidArgumentsGraphError(\n 'Graph.forEachNode: expecting a callback.'\n );\n\n const iterator = this._nodes.values();\n\n let step, nodeData;\n\n while (((step = iterator.next()), step.done !== true)) {\n nodeData = step.value;\n callback(nodeData.key, nodeData.attributes);\n }\n }\n\n /**\n * Method iterating attempting to find a node matching the given predicate\n * function.\n *\n * @param {function} callback - Callback (key, attributes).\n */\n findNode(callback) {\n if (typeof callback !== 'function')\n throw new InvalidArgumentsGraphError(\n 'Graph.findNode: expecting a callback.'\n );\n\n const iterator = this._nodes.values();\n\n let step, nodeData;\n\n while (((step = iterator.next()), step.done !== true)) {\n nodeData = step.value;\n\n if (callback(nodeData.key, nodeData.attributes)) return nodeData.key;\n }\n\n return;\n }\n\n /**\n * Method mapping nodes.\n *\n * @param {function} callback - Callback (key, attributes).\n */\n mapNodes(callback) {\n if (typeof callback !== 'function')\n throw new InvalidArgumentsGraphError(\n 'Graph.mapNode: expecting a callback.'\n );\n\n const iterator = this._nodes.values();\n\n let step, nodeData;\n\n const result = new Array(this.order);\n let i = 0;\n\n while (((step = iterator.next()), step.done !== true)) {\n nodeData = step.value;\n result[i++] = callback(nodeData.key, nodeData.attributes);\n }\n\n return result;\n }\n\n /**\n * Method returning whether some node verify the given predicate.\n *\n * @param {function} callback - Callback (key, attributes).\n */\n someNode(callback) {\n if (typeof callback !== 'function')\n throw new InvalidArgumentsGraphError(\n 'Graph.someNode: expecting a callback.'\n );\n\n const iterator = this._nodes.values();\n\n let step, nodeData;\n\n while (((step = iterator.next()), step.done !== true)) {\n nodeData = step.value;\n\n if (callback(nodeData.key, nodeData.attributes)) return true;\n }\n\n return false;\n }\n\n /**\n * Method returning whether all node verify the given predicate.\n *\n * @param {function} callback - Callback (key, attributes).\n */\n everyNode(callback) {\n if (typeof callback !== 'function')\n throw new InvalidArgumentsGraphError(\n 'Graph.everyNode: expecting a callback.'\n );\n\n const iterator = this._nodes.values();\n\n let step, nodeData;\n\n while (((step = iterator.next()), step.done !== true)) {\n nodeData = step.value;\n\n if (!callback(nodeData.key, nodeData.attributes)) return false;\n }\n\n return true;\n }\n\n /**\n * Method filtering nodes.\n *\n * @param {function} callback - Callback (key, attributes).\n */\n filterNodes(callback) {\n if (typeof callback !== 'function')\n throw new InvalidArgumentsGraphError(\n 'Graph.filterNodes: expecting a callback.'\n );\n\n const iterator = this._nodes.values();\n\n let step, nodeData;\n\n const result = [];\n\n while (((step = iterator.next()), step.done !== true)) {\n nodeData = step.value;\n\n if (callback(nodeData.key, nodeData.attributes))\n result.push(nodeData.key);\n }\n\n return result;\n }\n\n /**\n * Method reducing nodes.\n *\n * @param {function} callback - Callback (accumulator, key, attributes).\n */\n reduceNodes(callback, initialValue) {\n if (typeof callback !== 'function')\n throw new InvalidArgumentsGraphError(\n 'Graph.reduceNodes: expecting a callback.'\n );\n\n if (arguments.length < 2)\n throw new InvalidArgumentsGraphError(\n 'Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.'\n );\n\n let accumulator = initialValue;\n\n const iterator = this._nodes.values();\n\n let step, nodeData;\n\n while (((step = iterator.next()), step.done !== true)) {\n nodeData = step.value;\n accumulator = callback(accumulator, nodeData.key, nodeData.attributes);\n }\n\n return accumulator;\n }\n\n /**\n * Method returning an iterator over the graph's node entries.\n *\n * @return {Iterator}\n */\n nodeEntries() {\n const iterator = this._nodes.values();\n\n return new Iterator(() => {\n const step = iterator.next();\n\n if (step.done) return step;\n\n const data = step.value;\n\n return {\n value: {node: data.key, attributes: data.attributes},\n done: false\n };\n });\n }\n\n /**---------------------------------------------------------------------------\n * Serialization\n **---------------------------------------------------------------------------\n */\n\n /**\n * Method used to export the whole graph.\n *\n * @return {object} - The serialized graph.\n */\n export() {\n const nodes = new Array(this._nodes.size);\n\n let i = 0;\n\n this._nodes.forEach((data, key) => {\n nodes[i++] = serializeNode(key, data);\n });\n\n const edges = new Array(this._edges.size);\n\n i = 0;\n\n this._edges.forEach((data, key) => {\n edges[i++] = serializeEdge(this.type, key, data);\n });\n\n return {\n options: {\n type: this.type,\n multi: this.multi,\n allowSelfLoops: this.allowSelfLoops\n },\n attributes: this.getAttributes(),\n nodes,\n edges\n };\n }\n\n /**\n * Method used to import a serialized graph.\n *\n * @param {object|Graph} data - The serialized graph.\n * @param {boolean} merge - Whether to merge data.\n * @return {Graph} - Returns itself for chaining.\n */\n import(data, merge = false) {\n // Importing a Graph instance directly\n if (data instanceof Graph) {\n // Nodes\n data.forEachNode((n, a) => {\n if (merge) this.mergeNode(n, a);\n else this.addNode(n, a);\n });\n\n // Edges\n data.forEachEdge((e, a, s, t, _sa, _ta, u) => {\n if (merge) {\n if (u) this.mergeUndirectedEdgeWithKey(e, s, t, a);\n else this.mergeDirectedEdgeWithKey(e, s, t, a);\n } else {\n if (u) this.addUndirectedEdgeWithKey(e, s, t, a);\n else this.addDirectedEdgeWithKey(e, s, t, a);\n }\n });\n\n return this;\n }\n\n // Importing a serialized graph\n if (!isPlainObject(data))\n throw new InvalidArgumentsGraphError(\n 'Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.'\n );\n\n if (data.attributes) {\n if (!isPlainObject(data.attributes))\n throw new InvalidArgumentsGraphError(\n 'Graph.import: invalid attributes. Expecting a plain object.'\n );\n\n if (merge) this.mergeAttributes(data.attributes);\n else this.replaceAttributes(data.attributes);\n }\n\n let i, l, list, node, edge;\n\n if (data.nodes) {\n list = data.nodes;\n\n if (!Array.isArray(list))\n throw new InvalidArgumentsGraphError(\n 'Graph.import: invalid nodes. Expecting an array.'\n );\n\n for (i = 0, l = list.length; i < l; i++) {\n node = list[i];\n\n // Validating\n validateSerializedNode(node);\n\n // Adding the node\n const {key, attributes} = node;\n\n if (merge) this.mergeNode(key, attributes);\n else this.addNode(key, attributes);\n }\n }\n\n if (data.edges) {\n let undirectedByDefault = false;\n\n if (this.type === 'undirected') {\n undirectedByDefault = true;\n }\n\n list = data.edges;\n\n if (!Array.isArray(list))\n throw new InvalidArgumentsGraphError(\n 'Graph.import: invalid edges. Expecting an array.'\n );\n\n for (i = 0, l = list.length; i < l; i++) {\n edge = list[i];\n\n // Validating\n validateSerializedEdge(edge);\n\n // Adding the edge\n const {\n source,\n target,\n attributes,\n undirected = undirectedByDefault\n } = edge;\n\n let method;\n\n if ('key' in edge) {\n method = merge\n ? undirected\n ? this.mergeUndirectedEdgeWithKey\n : this.mergeDirectedEdgeWithKey\n : undirected\n ? this.addUndirectedEdgeWithKey\n : this.addDirectedEdgeWithKey;\n\n method.call(this, edge.key, source, target, attributes);\n } else {\n method = merge\n ? undirected\n ? this.mergeUndirectedEdge\n : this.mergeDirectedEdge\n : undirected\n ? this.addUndirectedEdge\n : this.addDirectedEdge;\n\n method.call(this, source, target, attributes);\n }\n }\n }\n\n return this;\n }\n\n /**---------------------------------------------------------------------------\n * Utils\n **---------------------------------------------------------------------------\n */\n\n /**\n * Method returning a null copy of the graph, i.e. a graph without nodes\n * & edges but with the exact same options.\n *\n * @param {object} options - Options to merge with the current ones.\n * @return {Graph} - The null copy.\n */\n nullCopy(options) {\n const graph = new Graph(assign({}, this._options, options));\n graph.replaceAttributes(assign({}, this.getAttributes()));\n return graph;\n }\n\n /**\n * Method returning an empty copy of the graph, i.e. a graph without edges but\n * with the exact same options.\n *\n * @param {object} options - Options to merge with the current ones.\n * @return {Graph} - The empty copy.\n */\n emptyCopy(options) {\n const graph = this.nullCopy(options);\n\n this._nodes.forEach((nodeData, key) => {\n const attributes = assign({}, nodeData.attributes);\n\n // NOTE: no need to emit events since user cannot access the instance yet\n nodeData = new graph.NodeDataClass(key, attributes);\n graph._nodes.set(key, nodeData);\n });\n\n return graph;\n }\n\n /**\n * Method returning an exact copy of the graph.\n *\n * @param {object} options - Upgrade options.\n * @return {Graph} - The copy.\n */\n copy(options) {\n options = options || {};\n\n if (\n typeof options.type === 'string' &&\n options.type !== this.type &&\n options.type !== 'mixed'\n )\n throw new UsageGraphError(\n `Graph.copy: cannot create an incompatible copy from \"${this.type}\" type to \"${options.type}\" because this would mean losing information about the current graph.`\n );\n\n if (\n typeof options.multi === 'boolean' &&\n options.multi !== this.multi &&\n options.multi !== true\n )\n throw new UsageGraphError(\n 'Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.'\n );\n\n if (\n typeof options.allowSelfLoops === 'boolean' &&\n options.allowSelfLoops !== this.allowSelfLoops &&\n options.allowSelfLoops !== true\n )\n throw new UsageGraphError(\n 'Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.'\n );\n\n const graph = this.emptyCopy(options);\n\n const iterator = this._edges.values();\n\n let step, edgeData;\n\n while (((step = iterator.next()), step.done !== true)) {\n edgeData = step.value;\n\n // NOTE: no need to emit events since user cannot access the instance yet\n addEdge(\n graph,\n 'copy',\n false,\n edgeData.undirected,\n edgeData.key,\n edgeData.source.key,\n edgeData.target.key,\n assign({}, edgeData.attributes)\n );\n }\n\n return graph;\n }\n\n /**---------------------------------------------------------------------------\n * Known methods\n **---------------------------------------------------------------------------\n */\n\n /**\n * Method used by JavaScript to perform JSON serialization.\n *\n * @return {object} - The serialized graph.\n */\n toJSON() {\n return this.export();\n }\n\n /**\n * Method returning [object Graph].\n */\n toString() {\n return '[object Graph]';\n }\n\n /**\n * Method used internally by node's console to display a custom object.\n *\n * @return {object} - Formatted object representation of the graph.\n */\n inspect() {\n const nodes = {};\n this._nodes.forEach((data, key) => {\n nodes[key] = data.attributes;\n });\n\n const edges = {},\n multiIndex = {};\n\n this._edges.forEach((data, key) => {\n const direction = data.undirected ? '--' : '->';\n\n let label = '';\n\n let source = data.source.key;\n let target = data.target.key;\n let tmp;\n\n if (data.undirected && source > target) {\n tmp = source;\n source = target;\n target = tmp;\n }\n\n const desc = `(${source})${direction}(${target})`;\n\n if (!key.startsWith('geid_')) {\n label += `[${key}]: `;\n } else if (this.multi) {\n if (typeof multiIndex[desc] === 'undefined') {\n multiIndex[desc] = 0;\n } else {\n multiIndex[desc]++;\n }\n\n label += `${multiIndex[desc]}. `;\n }\n\n label += desc;\n\n edges[label] = data.attributes;\n });\n\n const dummy = {};\n\n for (const k in this) {\n if (\n this.hasOwnProperty(k) &&\n !EMITTER_PROPS.has(k) &&\n typeof this[k] !== 'function' &&\n typeof k !== 'symbol'\n )\n dummy[k] = this[k];\n }\n\n dummy.attributes = this._attributes;\n dummy.nodes = nodes;\n dummy.edges = edges;\n\n privateProperty(dummy, 'constructor', this.constructor);\n\n return dummy;\n }\n}\n\n/**\n * Attaching methods to the prototype.\n *\n * Here, we are attaching a wide variety of methods to the Graph class'\n * prototype when those are very numerous and when their creation is\n * abstracted.\n */\n\n/**\n * Attaching custom inspect method for node >= 10.\n */\nif (typeof Symbol !== 'undefined')\n Graph.prototype[Symbol.for('nodejs.util.inspect.custom')] =\n Graph.prototype.inspect;\n\n/**\n * Related to edge addition.\n */\nEDGE_ADD_METHODS.forEach(method => {\n ['add', 'merge', 'update'].forEach(verb => {\n const name = method.name(verb);\n const fn = verb === 'add' ? addEdge : mergeEdge;\n\n if (method.generateKey) {\n Graph.prototype[name] = function (source, target, attributes) {\n return fn(\n this,\n name,\n true,\n (method.type || this.type) === 'undirected',\n null,\n source,\n target,\n attributes,\n verb === 'update'\n );\n };\n } else {\n Graph.prototype[name] = function (edge, source, target, attributes) {\n return fn(\n this,\n name,\n false,\n (method.type || this.type) === 'undirected',\n edge,\n source,\n target,\n attributes,\n verb === 'update'\n );\n };\n }\n });\n});\n\n/**\n * Attributes-related.\n */\nattachNodeAttributesMethods(Graph);\nattachEdgeAttributesMethods(Graph);\n\n/**\n * Edge iteration-related.\n */\nattachEdgeIterationMethods(Graph);\n\n/**\n * Neighbor iteration-related.\n */\nattachNeighborIterationMethods(Graph);\n","/**\n * Graphology Helper Classes\n * ==========================\n *\n * Building some higher-order classes instantiating the graph with\n * predefinite options.\n */\nimport {assign} from './utils';\nimport Graph from './graph';\n\nimport {\n InvalidArgumentsGraphError,\n NotFoundGraphError,\n UsageGraphError\n} from './errors';\n\n/**\n * Alternative constructors.\n */\nclass DirectedGraph extends Graph {\n constructor(options) {\n const finalOptions = assign({type: 'directed'}, options);\n\n if ('multi' in finalOptions && finalOptions.multi !== false)\n throw new InvalidArgumentsGraphError(\n 'DirectedGraph.from: inconsistent indication that the graph should be multi in given options!'\n );\n\n if (finalOptions.type !== 'directed')\n throw new InvalidArgumentsGraphError(\n 'DirectedGraph.from: inconsistent \"' +\n finalOptions.type +\n '\" type in given options!'\n );\n\n super(finalOptions);\n }\n}\nclass UndirectedGraph extends Graph {\n constructor(options) {\n const finalOptions = assign({type: 'undirected'}, options);\n\n if ('multi' in finalOptions && finalOptions.multi !== false)\n throw new InvalidArgumentsGraphError(\n 'UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!'\n );\n\n if (finalOptions.type !== 'undirected')\n throw new InvalidArgumentsGraphError(\n 'UndirectedGraph.from: inconsistent \"' +\n finalOptions.type +\n '\" type in given options!'\n );\n\n super(finalOptions);\n }\n}\nclass MultiGraph extends Graph {\n constructor(options) {\n const finalOptions = assign({multi: true}, options);\n\n if ('multi' in finalOptions && finalOptions.multi !== true)\n throw new InvalidArgumentsGraphError(\n 'MultiGraph.from: inconsistent indication that the graph should be simple in given options!'\n );\n\n super(finalOptions);\n }\n}\nclass MultiDirectedGraph extends Graph {\n constructor(options) {\n const finalOptions = assign({type: 'directed', multi: true}, options);\n\n if ('multi' in finalOptions && finalOptions.multi !== true)\n throw new InvalidArgumentsGraphError(\n 'MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!'\n );\n\n if (finalOptions.type !== 'directed')\n throw new InvalidArgumentsGraphError(\n 'MultiDirectedGraph.from: inconsistent \"' +\n finalOptions.type +\n '\" type in given options!'\n );\n\n super(finalOptions);\n }\n}\nclass MultiUndirectedGraph extends Graph {\n constructor(options) {\n const finalOptions = assign({type: 'undirected', multi: true}, options);\n\n if ('multi' in finalOptions && finalOptions.multi !== true)\n throw new InvalidArgumentsGraphError(\n 'MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!'\n );\n\n if (finalOptions.type !== 'undirected')\n throw new InvalidArgumentsGraphError(\n 'MultiUndirectedGraph.from: inconsistent \"' +\n finalOptions.type +\n '\" type in given options!'\n );\n\n super(finalOptions);\n }\n}\n\n/**\n * Attaching static #.from method to each of the constructors.\n */\nfunction attachStaticFromMethod(Class) {\n /**\n * Builds a graph from serialized data or another graph's data.\n *\n * @param {Graph|SerializedGraph} data - Hydratation data.\n * @param {object} [options] - Options.\n * @return {Class}\n */\n Class.from = function (data, options) {\n // Merging given options with serialized ones\n const finalOptions = assign({}, data.options, options);\n\n const instance = new Class(finalOptions);\n instance.import(data);\n\n return instance;\n };\n}\n\nattachStaticFromMethod(Graph);\nattachStaticFromMethod(DirectedGraph);\nattachStaticFromMethod(UndirectedGraph);\nattachStaticFromMethod(MultiGraph);\nattachStaticFromMethod(MultiDirectedGraph);\nattachStaticFromMethod(MultiUndirectedGraph);\n\nGraph.Graph = Graph;\nGraph.DirectedGraph = DirectedGraph;\nGraph.UndirectedGraph = UndirectedGraph;\nGraph.MultiGraph = MultiGraph;\nGraph.MultiDirectedGraph = MultiDirectedGraph;\nGraph.MultiUndirectedGraph = MultiUndirectedGraph;\n\nGraph.InvalidArgumentsGraphError = InvalidArgumentsGraphError;\nGraph.NotFoundGraphError = NotFoundGraphError;\nGraph.UsageGraphError = UsageGraphError;\n\nexport {\n Graph,\n DirectedGraph,\n UndirectedGraph,\n MultiGraph,\n MultiDirectedGraph,\n MultiUndirectedGraph\n};\n","/**\n * Graphology CommonJS Endoint\n * ============================\n *\n * Endpoint for CommonJS modules consumers.\n */\nimport {Graph} from './classes';\n\nexport default Graph;\n"],"names":["assignPolyfill","target","arguments","i","l","length","k","assign","Object","getMatchingEdge","graph","source","type","sourceData","_nodes","get","edge","out","undirected","isPlainObject","value","isEmpty","o","privateProperty","name","defineProperty","enumerable","configurable","writable","readOnlyProperty","descriptor","validateHints","hints","attributes","Array","isArray","incrementalIdStartingFromRandomByte","Math","floor","random","GraphError","message","Error","InvalidArgumentsGraphError","captureStackTrace","prototype","constructor","NotFoundGraphError","UsageGraphError","MixedNodeData","key","clear","inDegree","outDegree","undirectedDegree","undirectedLoops","directedLoops","DirectedNodeData","UndirectedNodeData","EdgeData","attach","outKey","inKey","attachMulti","adj","head","previous","next","detach","detachMulti","undefined","NODE","SOURCE","TARGET","OPPOSITE","findRelevantNodeData","method","mode","nodeOrEdge","nameOrEdge","add1","add2","nodeData","edgeData","arg1","arg2","_edges","attachNodeAttributeGetter","Class","data","attachNodeAttributesGetter","attachNodeAttributeChecker","hasOwnProperty","attachNodeAttributeSetter","emit","attachNodeAttributeUpdater","updater","attachNodeAttributeRemover","attachNodeAttributesReplacer","attachNodeAttributesMerger","attachNodeAttributesUpdater","NODE_ATTRIBUTES_METHODS","element","attacher","attachNodeAttributesMethods","Graph","forEach","attachEdgeAttributeGetter","multi","attachEdgeAttributesGetter","attachEdgeAttributeChecker","attachEdgeAttributeSetter","attachEdgeAttributeUpdater","attachEdgeAttributeRemover","attachEdgeAttributesReplacer","attachEdgeAttributesMerger","attachEdgeAttributesUpdater","EDGE_ATTRIBUTES_METHODS","attachEdgeAttributesMethods","EDGES_ITERATION","direction","forEachSimple","breakable","object","callback","avoid","shouldBreak","forEachMulti","createIterator","keys","Iterator","done","sourceAttributes","targetAttributes","forEachForKeySimple","targetData","forEachForKeyMulti","createIteratorForKey","of","createEdgeArray","size","from","take","undirectedSize","directedSize","list","mask","iterator","values","step","forEachEdge","shouldFilter","createEdgeIterator","empty","forEachEdgeForNode","fn","found","createEdgeArrayForNode","edges","push","createEdgeIteratorForNode","chain","forEachEdgeForPath","createEdgeArrayForPath","createEdgeIteratorForPath","attachEdgeArrayCreator","description","has","attachForEachEdge","forEachName","toUpperCase","slice","mapName","args","call","pop","result","e","ea","s","t","sa","ta","u","apply","filterName","reduceName","initialValue","accumulator","attachFindEdge","findEdgeName","someName","everyName","attachEdgeIteratorCreator","originalName","attachEdgeIterationMethods","NEIGHBORS_ITERATION","CompositeSetWrapper","A","B","wrap","set","forEachInObjectOnce","visited","neighborData","forEachNeighbor","createNeighborArrayForNode","neighbors","createDedupedObjectIterator","neighbor","createNeighborIterator","attachNeighborArrayCreator","node","attachForEachNeighbor","n","a","attachFindNeighbor","capitalizedSingular","findName","attachNeighborIteratorCreator","iteratorName","attachNeighborIterationMethods","forEachAdjacency","assymetric","disconnectedNodes","hasEdges","serializeNode","serialized","serializeEdge","validateSerializedNode","validateSerializedEdge","INSTANCE_ID","TYPES","Set","EMITTER_PROPS","EDGE_ADD_METHODS","verb","generateKey","DEFAULTS","allowSelfLoops","addNode","NodeDataClass","unsafeAddNode","addEdge","mustGenerateKey","eventData","_edgeKeyGenerator","isSelfLoop","_undirectedSelfLoopCount","_directedSelfLoopCount","_undirectedSize","_directedSize","mergeEdge","asUpdater","alreadyExistingEdgeData","info","oldAttributes","sourceWasAdded","targetWasAdded","dropEdgeFromData","options","instancePrefix","edgeId","edgeKeyGenerator","availableEdgeKey","Map","prop","_options","_resetInstanceCounters","hasNode","hasDirectedEdge","hasUndirectedEdge","hasEdge","directedEdge","undirectedEdge","areDirectedNeighbors","areOutNeighbors","areInNeighbors","areUndirectedNeighbors","areNeighbors","areInboundNeighbors","areOutboundNeighbors","directedDegree","inboundDegree","degree","outboundDegree","inDegreeWithoutSelfLoops","outDegreeWithoutSelfLoops","directedDegreeWithoutSelfLoops","undirectedDegreeWithoutSelfLoops","inboundDegreeWithoutSelfLoops","loops","outboundDegreeWithoutSelfLoops","degreeWithoutSelfLoops","extremities","opposite","hasExtremity","isUndirected","isDirected","mergeNode","updateNode","dropNode","dropEdge","dropDirectedEdge","dropUndirectedEdge","clearEdges","getAttribute","_attributes","getAttributes","hasAttribute","setAttribute","updateAttribute","removeAttribute","replaceAttributes","mergeAttributes","updateAttributes","updateEachNodeAttributes","updateEachEdgeAttributes","forEachAdjacencyEntry","forEachAdjacencyEntryWithOrphans","forEachAssymetricAdjacencyEntry","forEachAssymetricAdjacencyEntryWithOrphans","nodes","forEachNode","findNode","mapNodes","order","someNode","everyNode","filterNodes","reduceNodes","nodeEntries","merge","_sa","_ta","mergeUndirectedEdgeWithKey","mergeDirectedEdgeWithKey","addUndirectedEdgeWithKey","addDirectedEdgeWithKey","undirectedByDefault","mergeUndirectedEdge","mergeDirectedEdge","addUndirectedEdge","addDirectedEdge","nullCopy","emptyCopy","copy","toJSON","toString","inspect","multiIndex","label","tmp","desc","startsWith","dummy","EventEmitter","Symbol","DirectedGraph","finalOptions","UndirectedGraph","MultiGraph","MultiDirectedGraph","MultiUndirectedGraph","attachStaticFromMethod","instance"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,cAAc,GAAG;AACxB,EAAA,IAAMC,MAAM,GAAGC,SAAS,CAAC,CAAC,CAAC,CAAA;AAE3B,EAAA,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAGF,SAAS,CAACG,MAAM,EAAEF,CAAC,GAAGC,CAAC,EAAED,CAAC,EAAE,EAAE;AAChD,IAAA,IAAI,CAACD,SAAS,CAACC,CAAC,CAAC,E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