New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

graphology

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphology - npm Package Compare versions

Comparing version

to
0.26.0-rc1

14

package.json
{
"name": "graphology",
"version": "0.26.0-alpha1",
"version": "0.26.0-rc1",
"description": "A robust and multipurpose Graph object for JavaScript.",

@@ -9,6 +9,2 @@ "main": "dist/graphology.cjs.js",

"types": "dist/graphology.d.ts",
"exports": {
"require": "./dist/graphology.cjs.js",
"import": "./dist/graphology.mjs"
},
"scripts": {

@@ -60,4 +56,3 @@ "clean": "rimraf dist specs",

"dependencies": {
"events": "^3.3.0",
"obliterator": "^2.0.2"
"events": "^3.3.0"
},

@@ -91,3 +86,8 @@ "peerDependencies": {

]
},
"exports": {
"require": "./dist/graphology.cjs.js",
"import": "./dist/graphology.mjs",
"types": "./dist/graphology.d.ts"
}
}

@@ -9,6 +9,14 @@ "use strict";

var _helpers = require("./helpers");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
* Graphology Attributes Specs
* ============================
*
* Testing the attributes-related methods of the graph.
*/
function attributes(Graph, checkers) {

@@ -20,3 +28,3 @@ var invalid = checkers.invalid,

return _defineProperty({}, '#.' + method, {
'it should throw if the given path is not found.': function itShouldThrowIfTheGivenPathIsNotFound() {
'it should throw if the given path is not found.': function it_should_throw_if_the_given_path_is_not_found() {
if (!method.includes('Edge')) return;

@@ -28,3 +36,3 @@ var graph = new Graph();

},
'it should throw when using a path on a multi graph.': function itShouldThrowWhenUsingAPathOnAMultiGraph() {
'it should throw when using a path on a multi graph.': function it_should_throw_when_using_a_path_on_a_multi_graph() {
if (!method.includes('Edge')) return;

@@ -38,3 +46,3 @@ var graph = new Graph({

},
'it should throw if the element is not found in the graph.': function itShouldThrowIfTheElementIsNotFoundInTheGraph() {
'it should throw if the element is not found in the graph.': function it_should_throw_if_the_element_is_not_found_in_the_graph() {
var graph = new Graph();

@@ -62,3 +70,3 @@ if (method.includes('Edge') && method.includes('Directed') || method.includes('Undirected')) {

'#.getAttribute': {
'it should return the correct value.': function itShouldReturnTheCorrectValue() {
'it should return the correct value.': function it_should_return_the_correct_value() {
var graph = new Graph();

@@ -68,3 +76,3 @@ graph.setAttribute('name', 'graph');

},
'it should return undefined if the attribute does not exist.': function itShouldReturnUndefinedIfTheAttributeDoesNotExist() {
'it should return undefined if the attribute does not exist.': function it_should_return_undefined_if_the_attribute_does_not_exist() {
var graph = new Graph();

@@ -75,3 +83,3 @@ _assert["default"].strictEqual(graph.getAttribute('name'), undefined);

'#.getNodeAttribute': {
'it should return the correct value.': function itShouldReturnTheCorrectValue() {
'it should return the correct value.': function it_should_return_the_correct_value() {
var graph = new Graph();

@@ -83,3 +91,3 @@ graph.addNode('Martha', {

},
'it should return undefined if the attribute does not exist.': function itShouldReturnUndefinedIfTheAttributeDoesNotExist() {
'it should return undefined if the attribute does not exist.': function it_should_return_undefined_if_the_attribute_does_not_exist() {
var graph = new Graph();

@@ -91,3 +99,3 @@ graph.addNode('Martha');

'#.getSourceAttribute': {
'it should return the correct value.': function itShouldReturnTheCorrectValue() {
'it should return the correct value.': function it_should_return_the_correct_value() {
var graph = new Graph();

@@ -101,3 +109,3 @@ graph.addNode('Martha', {

},
'it should return undefined if the attribute does not exist.': function itShouldReturnUndefinedIfTheAttributeDoesNotExist() {
'it should return undefined if the attribute does not exist.': function it_should_return_undefined_if_the_attribute_does_not_exist() {
var graph = new Graph();

@@ -111,3 +119,3 @@ graph.addNode('Martha');

'#.getTargetAttribute': {
'it should return the correct value.': function itShouldReturnTheCorrectValue() {
'it should return the correct value.': function it_should_return_the_correct_value() {
var graph = new Graph();

@@ -121,3 +129,3 @@ graph.addNode('Martha', {

},
'it should return undefined if the attribute does not exist.': function itShouldReturnUndefinedIfTheAttributeDoesNotExist() {
'it should return undefined if the attribute does not exist.': function it_should_return_undefined_if_the_attribute_does_not_exist() {
var graph = new Graph();

@@ -131,3 +139,3 @@ graph.addNode('Martha');

'#.getOppositeAttribute': {
'it should return the correct value.': function itShouldReturnTheCorrectValue() {
'it should return the correct value.': function it_should_return_the_correct_value() {
var graph = new Graph();

@@ -147,3 +155,3 @@ graph.addNode('Martha', {

'#.getEdgeAttribute': {
'it should return the correct value.': function itShouldReturnTheCorrectValue() {
'it should return the correct value.': function it_should_return_the_correct_value() {
var graph = new Graph();

@@ -157,3 +165,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Thomas']);

},
'it should also work with typed edges.': function itShouldAlsoWorkWithTypedEdges() {
'it should also work with typed edges.': function it_should_also_work_with_typed_edges() {
var graph = new Graph();

@@ -170,3 +178,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Thomas']);

},
'it should return undefined if the attribute does not exist.': function itShouldReturnUndefinedIfTheAttributeDoesNotExist() {
'it should return undefined if the attribute does not exist.': function it_should_return_undefined_if_the_attribute_does_not_exist() {
var graph = new Graph();

@@ -179,3 +187,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Thomas']);

'#.getAttributes': {
'it should return the correct value.': function itShouldReturnTheCorrectValue() {
'it should return the correct value.': function it_should_return_the_correct_value() {
var graph = new Graph();

@@ -187,3 +195,3 @@ graph.setAttribute('name', 'graph');

},
'it should return an empty object if the node does not have attributes.': function itShouldReturnAnEmptyObjectIfTheNodeDoesNotHaveAttributes() {
'it should return an empty object if the node does not have attributes.': function it_should_return_an_empty_object_if_the_node_does_not_have_attributes() {
var graph = new Graph();

@@ -194,3 +202,3 @@ _assert["default"].deepStrictEqual(graph.getAttributes(), {});

'#.getNodeAttributes': {
'it should return the correct value.': function itShouldReturnTheCorrectValue() {
'it should return the correct value.': function it_should_return_the_correct_value() {
var graph = new Graph();

@@ -204,3 +212,3 @@ graph.addNode('Martha', {

},
'it should return an empty object if the node does not have attributes.': function itShouldReturnAnEmptyObjectIfTheNodeDoesNotHaveAttributes() {
'it should return an empty object if the node does not have attributes.': function it_should_return_an_empty_object_if_the_node_does_not_have_attributes() {
var graph = new Graph();

@@ -212,3 +220,3 @@ graph.addNode('Martha');

'#.getEdgeAttributes': {
'it should return the correct value.': function itShouldReturnTheCorrectValue() {
'it should return the correct value.': function it_should_return_the_correct_value() {
var graph = new Graph();

@@ -226,3 +234,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Thomas']);

},
'it should also work with typed edges.': function itShouldAlsoWorkWithTypedEdges() {
'it should also work with typed edges.': function it_should_also_work_with_typed_edges() {
var graph = new Graph();

@@ -243,3 +251,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Thomas']);

},
'it should return an empty object if the edge does not have attributes.': function itShouldReturnAnEmptyObjectIfTheEdgeDoesNotHaveAttributes() {
'it should return an empty object if the edge does not have attributes.': function it_should_return_an_empty_object_if_the_edge_does_not_have_attributes() {
var graph = new Graph();

@@ -252,3 +260,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Thomas']);

'#.hasAttribute': {
'it should correctly return whether the attribute is set.': function itShouldCorrectlyReturnWhetherTheAttributeIsSet() {
'it should correctly return whether the attribute is set.': function it_should_correctly_return_whether_the_attribute_is_set() {
var graph = new Graph();

@@ -259,3 +267,3 @@ graph.setAttribute('name', 'graph');

},
'it does not fail with typical prototypal properties.': function itDoesNotFailWithTypicalPrototypalProperties() {
'it does not fail with typical prototypal properties.': function it_does_not_fail_with_typical_prototypal_properties() {
var graph = new Graph();

@@ -266,3 +274,3 @@ _assert["default"].strictEqual(graph.hasAttribute('toString'), false);

'#.hasNodeAttribute': {
'it should correctly return whether the attribute is set.': function itShouldCorrectlyReturnWhetherTheAttributeIsSet() {
'it should correctly return whether the attribute is set.': function it_should_correctly_return_whether_the_attribute_is_set() {
var graph = new Graph();

@@ -275,3 +283,3 @@ graph.addNode('John', {

},
'it does not fail with typical prototypal properties.': function itDoesNotFailWithTypicalPrototypalProperties() {
'it does not fail with typical prototypal properties.': function it_does_not_fail_with_typical_prototypal_properties() {
var graph = new Graph();

@@ -285,3 +293,3 @@ graph.addNode('John', {

'#.hasEdgeAttribute': {
'it should correctly return whether the attribute is set.': function itShouldCorrectlyReturnWhetherTheAttributeIsSet() {
'it should correctly return whether the attribute is set.': function it_should_correctly_return_whether_the_attribute_is_set() {
var graph = new Graph();

@@ -295,3 +303,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Martha']);

},
'it should also work with typed edges.': function itShouldAlsoWorkWithTypedEdges() {
'it should also work with typed edges.': function it_should_also_work_with_typed_edges() {
var graph = new Graph();

@@ -306,3 +314,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Thomas']);

},
'it does not fail with typical prototypal properties.': function itDoesNotFailWithTypicalPrototypalProperties() {
'it does not fail with typical prototypal properties.': function it_does_not_fail_with_typical_prototypal_properties() {
var graph = new Graph();

@@ -317,3 +325,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Martha']);

'#.setAttribute': {
"it should correctly set the graph's attribute.": function itShouldCorrectlySetTheGraphSAttribute() {
"it should correctly set the graph's attribute.": function it_should_correctly_set_the_graphS_attribute() {
var graph = new Graph();

@@ -325,3 +333,3 @@ graph.setAttribute('name', 'graph');

'#.setNodeAttribute': {
"it should correctly set the node's attribute.": function itShouldCorrectlySetTheNodeSAttribute() {
"it should correctly set the node's attribute.": function it_should_correctly_set_the_nodeS_attribute() {
var graph = new Graph();

@@ -336,3 +344,3 @@ graph.addNode('John', {

'#.setEdgeAttribute': {
"it should correctly set the edge's attribute.": function itShouldCorrectlySetTheEdgeSAttribute() {
"it should correctly set the edge's attribute.": function it_should_correctly_set_the_edgeS_attribute() {
var graph = new Graph();

@@ -348,3 +356,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Martha']);

},
'it should also work with typed edges.': function itShouldAlsoWorkWithTypedEdges() {
'it should also work with typed edges.': function it_should_also_work_with_typed_edges() {
var graph = new Graph();

@@ -365,3 +373,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Thomas']);

'#.updateAttribute': {
'it should throw if the updater is not a function.': function itShouldThrowIfTheUpdaterIsNotAFunction() {
'it should throw if the updater is not a function.': function it_should_throw_if_the_updater_is_not_a_function() {
var graph = new Graph();

@@ -375,3 +383,3 @@ graph.setAttribute('count', 0);

},
"it should correctly set the graph's attribute.": function itShouldCorrectlySetTheGraphSAttribute() {
"it should correctly set the graph's attribute.": function it_should_correctly_set_the_graphS_attribute() {
var graph = new Graph();

@@ -384,3 +392,3 @@ graph.setAttribute('name', 'graph');

},
'the given value should be undefined if not found.': function theGivenValueShouldBeUndefinedIfNotFound() {
'the given value should be undefined if not found.': function the_given_value_should_be_undefined_if_not_found() {
var graph = new Graph();

@@ -396,3 +404,3 @@ var updater = function updater(x) {

'#.updateNodeAttribute': {
'it should throw if given an invalid updater.': function itShouldThrowIfGivenAnInvalidUpdater() {
'it should throw if given an invalid updater.': function it_should_throw_if_given_an_invalid_updater() {
var graph = new Graph();

@@ -408,3 +416,3 @@ graph.addNode('John', {

},
'it should throw if not enough arguments are provided.': function itShouldThrowIfNotEnoughArgumentsAreProvided() {
'it should throw if not enough arguments are provided.': function it_should_throw_if_not_enough_arguments_are_provided() {
var graph = new Graph();

@@ -418,3 +426,3 @@ graph.addNode('Lucy');

},
"it should correctly set the node's attribute.": function itShouldCorrectlySetTheNodeSAttribute() {
"it should correctly set the node's attribute.": function it_should_correctly_set_the_nodeS_attribute() {
var graph = new Graph();

@@ -429,3 +437,3 @@ graph.addNode('John', {

},
'the given value should be undefined if not found.': function theGivenValueShouldBeUndefinedIfNotFound() {
'the given value should be undefined if not found.': function the_given_value_should_be_undefined_if_not_found() {
var graph = new Graph();

@@ -442,3 +450,3 @@ graph.addNode('John');

'#.updateEdgeAttribute': {
'it should throw if given an invalid updater.': function itShouldThrowIfGivenAnInvalidUpdater() {
'it should throw if given an invalid updater.': function it_should_throw_if_given_an_invalid_updater() {
var graph = new Graph();

@@ -455,3 +463,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Martha']);

},
"it should correctly set the edge's attribute.": function itShouldCorrectlySetTheEdgeSAttribute() {
"it should correctly set the edge's attribute.": function it_should_correctly_set_the_edgeS_attribute() {
var graph = new Graph();

@@ -471,3 +479,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Martha']);

},
'it should also work with typed edges.': function itShouldAlsoWorkWithTypedEdges() {
'it should also work with typed edges.': function it_should_also_work_with_typed_edges() {
var graph = new Graph();

@@ -490,3 +498,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Thomas']);

},
'the given value should be undefined if not found.': function theGivenValueShouldBeUndefinedIfNotFound() {
'the given value should be undefined if not found.': function the_given_value_should_be_undefined_if_not_found() {
var graph = new Graph();

@@ -504,3 +512,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Martha']);

'#.removeAttribute': {
'it should correctly remove the attribute.': function itShouldCorrectlyRemoveTheAttribute() {
'it should correctly remove the attribute.': function it_should_correctly_remove_the_attribute() {
var graph = new Graph();

@@ -514,3 +522,3 @@ graph.setAttribute('name', 'graph');

'#.removeNodeAttribute': {
'it should correctly remove the attribute.': function itShouldCorrectlyRemoveTheAttribute() {
'it should correctly remove the attribute.': function it_should_correctly_remove_the_attribute() {
var graph = new Graph();

@@ -526,3 +534,3 @@ graph.addNode('Martha', {

'#.removeEdgeAttribute': {
'it should correclty remove the attribute.': function itShouldCorrecltyRemoveTheAttribute() {
'it should correclty remove the attribute.': function it_should_correclty_remove_the_attribute() {
var graph = new Graph();

@@ -540,3 +548,3 @@ var _graph$mergeEdge6 = graph.mergeEdge('John', 'Martha', {

},
'it should also work with typed edges.': function itShouldAlsoWorkWithTypedEdges() {
'it should also work with typed edges.': function it_should_also_work_with_typed_edges() {
var graph = new Graph();

@@ -557,3 +565,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Thomas']);

'#.replaceAttribute': {
'it should throw if given attributes are not a plain object.': function itShouldThrowIfGivenAttributesAreNotAPlainObject() {
'it should throw if given attributes are not a plain object.': function it_should_throw_if_given_attributes_are_not_a_plain_object() {
var graph = new Graph();

@@ -564,3 +572,3 @@ _assert["default"]["throws"](function () {

},
'it should correctly replace attributes.': function itShouldCorrectlyReplaceAttributes() {
'it should correctly replace attributes.': function it_should_correctly_replace_attributes() {
var graph = new Graph();

@@ -577,3 +585,3 @@ graph.setAttribute('name', 'graph');

'#.replaceNodeAttributes': {
'it should throw if given attributes are not a plain object.': function itShouldThrowIfGivenAttributesAreNotAPlainObject() {
'it should throw if given attributes are not a plain object.': function it_should_throw_if_given_attributes_are_not_a_plain_object() {
var graph = new Graph();

@@ -585,3 +593,3 @@ graph.addNode('John');

},
'it should correctly replace attributes.': function itShouldCorrectlyReplaceAttributes() {
'it should correctly replace attributes.': function it_should_correctly_replace_attributes() {
var graph = new Graph();

@@ -602,3 +610,3 @@ graph.addNode('John', {

'#.replaceEdgeAttributes': {
'it should throw if given attributes are not a plain object.': function itShouldThrowIfGivenAttributesAreNotAPlainObject() {
'it should throw if given attributes are not a plain object.': function it_should_throw_if_given_attributes_are_not_a_plain_object() {
var graph = new Graph();

@@ -611,3 +619,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Martha']);

},
'it should also work with typed edges.': function itShouldAlsoWorkWithTypedEdges() {
'it should also work with typed edges.': function it_should_also_work_with_typed_edges() {
var graph = new Graph();

@@ -634,3 +642,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Thomas']);

},
'it should correctly replace attributes.': function itShouldCorrectlyReplaceAttributes() {
'it should correctly replace attributes.': function it_should_correctly_replace_attributes() {
var graph = new Graph();

@@ -652,3 +660,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Martha']);

'#.mergeAttributes': {
'it should throw if given attributes are not a plain object.': function itShouldThrowIfGivenAttributesAreNotAPlainObject() {
'it should throw if given attributes are not a plain object.': function it_should_throw_if_given_attributes_are_not_a_plain_object() {
var graph = new Graph();

@@ -659,3 +667,3 @@ _assert["default"]["throws"](function () {

},
'it should correctly merge attributes.': function itShouldCorrectlyMergeAttributes() {
'it should correctly merge attributes.': function it_should_correctly_merge_attributes() {
var graph = new Graph();

@@ -673,3 +681,3 @@ graph.setAttribute('name', 'graph');

'#.mergeNodeAttributes': {
'it should throw if given attributes are not a plain object.': function itShouldThrowIfGivenAttributesAreNotAPlainObject() {
'it should throw if given attributes are not a plain object.': function it_should_throw_if_given_attributes_are_not_a_plain_object() {
var graph = new Graph();

@@ -681,3 +689,3 @@ graph.addNode('John');

},
'it should correctly merge attributes.': function itShouldCorrectlyMergeAttributes() {
'it should correctly merge attributes.': function it_should_correctly_merge_attributes() {
var graph = new Graph();

@@ -697,3 +705,3 @@ graph.addNode('John', {

'#.mergeEdgeAttributes': {
'it should throw if given attributes are not a plain object.': function itShouldThrowIfGivenAttributesAreNotAPlainObject() {
'it should throw if given attributes are not a plain object.': function it_should_throw_if_given_attributes_are_not_a_plain_object() {
var graph = new Graph();

@@ -706,3 +714,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Martha']);

},
'it should also work with typed edges.': function itShouldAlsoWorkWithTypedEdges() {
'it should also work with typed edges.': function it_should_also_work_with_typed_edges() {
var graph = new Graph();

@@ -731,3 +739,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Thomas']);

},
'it should correctly merge attributes.': function itShouldCorrectlyMergeAttributes() {
'it should correctly merge attributes.': function it_should_correctly_merge_attributes() {
var graph = new Graph();

@@ -748,3 +756,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Martha']);

'#.updateAttributes': {
'it should throw if given updater is not a function.': function itShouldThrowIfGivenUpdaterIsNotAFunction() {
'it should throw if given updater is not a function.': function it_should_throw_if_given_updater_is_not_a_function() {
var graph = new Graph();

@@ -755,3 +763,3 @@ _assert["default"]["throws"](function () {

},
'it should correctly update attributes.': function itShouldCorrectlyUpdateAttributes() {
'it should correctly update attributes.': function it_should_correctly_update_attributes() {
var graph = new Graph();

@@ -771,3 +779,3 @@ graph.setAttribute('name', 'graph');

'#.updateNodeAttributes': {
'it should throw if given updater is not a function': function itShouldThrowIfGivenUpdaterIsNotAFunction() {
'it should throw if given updater is not a function': function it_should_throw_if_given_updater_is_not_a_function() {
var graph = new Graph();

@@ -779,3 +787,3 @@ graph.addNode('John');

},
'it should correctly update attributes.': function itShouldCorrectlyUpdateAttributes() {
'it should correctly update attributes.': function it_should_correctly_update_attributes() {
var graph = new Graph();

@@ -797,3 +805,3 @@ graph.addNode('John', {

'#.updateEdgeAttributes': {
'it should throw if given updater is not a function.': function itShouldThrowIfGivenUpdaterIsNotAFunction() {
'it should throw if given updater is not a function.': function it_should_throw_if_given_updater_is_not_a_function() {
var graph = new Graph();

@@ -806,3 +814,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Martha']);

},
'it should also work with typed edges.': function itShouldAlsoWorkWithTypedEdges() {
'it should also work with typed edges.': function it_should_also_work_with_typed_edges() {
var graph = new Graph();

@@ -835,3 +843,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Thomas']);

},
'it should correctly update attributes.': function itShouldCorrectlyUpdateAttributes() {
'it should correctly update attributes.': function it_should_correctly_update_attributes() {
var graph = new Graph();

@@ -854,3 +862,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Martha']);

'#.updateEachNodeAttributes': {
'it should throw when given invalid arguments.': function itShouldThrowWhenGivenInvalidArguments() {
'it should throw when given invalid arguments.': function it_should_throw_when_given_invalid_arguments() {
var graph = new Graph();

@@ -869,3 +877,3 @@ _assert["default"]["throws"](function () {

},
"it should update each node's attributes.": function itShouldUpdateEachNodeSAttributes() {
"it should update each node's attributes.": function it_should_update_each_nodeS_attributes() {
var graph = new Graph();

@@ -898,3 +906,3 @@ graph.addNode('John', {

'#.updateEachEdgeAttributes': {
'it should throw when given invalid arguments.': function itShouldThrowWhenGivenInvalidArguments() {
'it should throw when given invalid arguments.': function it_should_throw_when_given_invalid_arguments() {
var graph = new Graph();

@@ -913,3 +921,3 @@ _assert["default"]["throws"](function () {

},
"it should update each node's attributes.": function itShouldUpdateEachNodeSAttributes() {
"it should update each node's attributes.": function it_should_update_each_nodeS_attributes() {
var graph = new Graph();

@@ -916,0 +924,0 @@ graph.mergeEdgeWithKey(0, 'John', 'Lucy', {

@@ -9,6 +9,14 @@ "use strict";

var _helpers = require("./helpers");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
* Graphology Events Specs
* ========================
*
* Testing the graph's events.
*/
var VALID_TYPES = new Set(['set', 'merge', 'replace', 'remove']);

@@ -18,3 +26,3 @@ function events(Graph) {

nodeAdded: {
'it should fire when a node is added.': function itShouldFireWhenANodeIsAdded() {
'it should fire when a node is added.': function it_should_fire_when_a_node_is_added() {
var graph = new Graph();

@@ -35,3 +43,3 @@ var handler = (0, _helpers.spy)(function (data) {

edgeAdded: {
'it should fire when an edge is added.': function itShouldFireWhenAnEdgeIsAdded() {
'it should fire when an edge is added.': function it_should_fire_when_an_edge_is_added() {
var graph = new Graph();

@@ -56,3 +64,3 @@ var handler = (0, _helpers.spy)(function (data) {

nodeDropped: {
'it should fire when a node is dropped.': function itShouldFireWhenANodeIsDropped() {
'it should fire when a node is dropped.': function it_should_fire_when_a_node_is_dropped() {
var graph = new Graph();

@@ -74,3 +82,3 @@ var handler = (0, _helpers.spy)(function (data) {

edgeDropped: {
'it should fire when an edge is added.': function itShouldFireWhenAnEdgeIsAdded() {
'it should fire when an edge is added.': function it_should_fire_when_an_edge_is_added() {
var graph = new Graph();

@@ -96,3 +104,3 @@ var handler = (0, _helpers.spy)(function (data) {

cleared: {
'it should fire when the graph is cleared.': function itShouldFireWhenTheGraphIsCleared() {
'it should fire when the graph is cleared.': function it_should_fire_when_the_graph_is_cleared() {
var graph = new Graph();

@@ -106,3 +114,3 @@ var handler = (0, _helpers.spy)();

attributesUpdated: {
'it should fire when a graph attribute is updated.': function itShouldFireWhenAGraphAttributeIsUpdated() {
'it should fire when a graph attribute is updated.': function it_should_fire_when_a_graph_attribute_is_updated() {
var graph = new Graph();

@@ -135,3 +143,3 @@ var handler = (0, _helpers.spy)(function (payload) {

nodeAttributesUpdated: {
"it should fire when a node's attributes are updated.": function itShouldFireWhenANodeSAttributesAreUpdated() {
"it should fire when a node's attributes are updated.": function it_should_fire_when_a_nodeS_attributes_are_updated() {
var graph = new Graph();

@@ -164,3 +172,3 @@ var handler = (0, _helpers.spy)(function (payload) {

},
'it should fire when a node is merged.': function itShouldFireWhenANodeIsMerged() {
'it should fire when a node is merged.': function it_should_fire_when_a_node_is_merged() {
var graph = new Graph();

@@ -191,3 +199,3 @@ var handler = (0, _helpers.spy)(function (payload) {

},
'it should fire when a node is updated.': function itShouldFireWhenANodeIsUpdated() {
'it should fire when a node is updated.': function it_should_fire_when_a_node_is_updated() {
var graph = new Graph();

@@ -219,3 +227,3 @@ var handler = (0, _helpers.spy)(function (payload) {

edgeAttributesUpdated: {
"it should fire when an edge's attributes are updated.": function itShouldFireWhenAnEdgeSAttributesAreUpdated() {
"it should fire when an edge's attributes are updated.": function it_should_fire_when_an_edgeS_attributes_are_updated() {
var graph = new Graph();

@@ -249,3 +257,3 @@ var handler = (0, _helpers.spy)(function (payload) {

},
'it should fire when an edge is merged.': function itShouldFireWhenAnEdgeIsMerged() {
'it should fire when an edge is merged.': function it_should_fire_when_an_edge_is_merged() {
var graph = new Graph();

@@ -276,3 +284,3 @@ var handler = (0, _helpers.spy)(function (payload) {

},
'it should fire when an edge is updated.': function itShouldFireWhenAnEdgeIsUpdated() {
'it should fire when an edge is updated.': function it_should_fire_when_an_edge_is_updated() {
var graph = new Graph();

@@ -304,3 +312,3 @@ var handler = (0, _helpers.spy)(function (payload) {

eachNodeAttributesUpdated: {
'it should fire when using #.updateEachNodeAttributes.': function itShouldFireWhenUsingUpdateEachNodeAttributes() {
'it should fire when using #.updateEachNodeAttributes.': function it_should_fire_when_using_UpdateEachNodeAttributes() {
var graph = new Graph();

@@ -327,3 +335,3 @@ graph.addNode('John', {

},
'it should provide hints when user gave them.': function itShouldProvideHintsWhenUserGaveThem() {
'it should provide hints when user gave them.': function it_should_provide_hints_when_user_gave_them() {
var graph = new Graph();

@@ -356,3 +364,3 @@ graph.addNode('John', {

eachEdgeAttributesUpdated: {
'it should fire when using #.updateEachEdgeAttributes.': function itShouldFireWhenUsingUpdateEachEdgeAttributes() {
'it should fire when using #.updateEachEdgeAttributes.': function it_should_fire_when_using_UpdateEachEdgeAttributes() {
var graph = new Graph();

@@ -376,3 +384,3 @@ graph.mergeEdgeWithKey(0, 'John', 'Lucy', {

},
'it should provide hints when user gave them.': function itShouldProvideHintsWhenUserGaveThem() {
'it should provide hints when user gave them.': function it_should_provide_hints_when_user_gave_them() {
var graph = new Graph();

@@ -379,0 +387,0 @@ graph.mergeEdgeWithKey(0, 'John', 'Lucy', {

@@ -11,3 +11,3 @@ "use strict";

exports.spy = spy;
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
/**

@@ -69,10 +69,10 @@ * Graphology Specs Helpers

function spy(target) {
var fn = function fn() {
fn.called = true;
fn.times++;
var _fn = function fn() {
_fn.called = true;
_fn.times++;
if (typeof target === 'function') return target.apply(null, arguments);
};
fn.called = false;
fn.times = 0;
return fn;
_fn.called = false;
_fn.times = 0;
return _fn;
}

@@ -79,0 +79,0 @@

@@ -18,3 +18,3 @@ "use strict";

var _misc = _interopRequireDefault(require("./misc"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
/**

@@ -21,0 +21,0 @@ * Graphology Specs

@@ -9,3 +9,3 @@ "use strict";

var _helpers = require("./helpers");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
/* eslint no-unused-vars: 0 */

@@ -40,3 +40,3 @@ /**

'Static #.from method': {
'it should be possible to create a Graph from a Graph instance.': function itShouldBePossibleToCreateAGraphFromAGraphInstance() {
'it should be possible to create a Graph from a Graph instance.': function it_should_be_possible_to_create_a_Graph_from_a_Graph_instance() {
var graph = new Graph();

@@ -49,3 +49,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Thomas']);

},
'it should be possible to create a Graph from a serialized graph': function itShouldBePossibleToCreateAGraphFromASerializedGraph() {
'it should be possible to create a Graph from a serialized graph': function it_should_be_possible_to_create_a_Graph_from_a_serialized_graph() {
var graph = Graph.from({

@@ -65,3 +65,3 @@ nodes: [{

},
'it should be possible to provide options.': function itShouldBePossibleToProvideOptions() {
'it should be possible to provide options.': function it_should_be_possible_to_provide_options() {
var graph = Graph.from({

@@ -80,3 +80,3 @@ node: [{

},
'it should be possible to take options from the serialized format.': function itShouldBePossibleToTakeOptionsFromTheSerializedFormat() {
'it should be possible to take options from the serialized format.': function it_should_be_possible_to_take_options_from_the_serialized_format() {
var graph = Graph.from({

@@ -98,3 +98,3 @@ node: [{

},
'given options should take precedence over the serialization ones.': function givenOptionsShouldTakePrecedenceOverTheSerializationOnes() {
'given options should take precedence over the serialization ones.': function given_options_should_take_precedence_over_the_serialization_ones() {
var graph = Graph.from({

@@ -124,3 +124,3 @@ node: [{

allowSelfLoops: {
'providing a non-boolean value should throw.': function providingANonBooleanValueShouldThrow() {
'providing a non-boolean value should throw.': function providing_a_nonBoolean_value_should_throw() {
_assert["default"]["throws"](function () {

@@ -137,3 +137,3 @@ var graph = new Graph({

multi: {
'providing a non-boolean value should throw.': function providingANonBooleanValueShouldThrow() {
'providing a non-boolean value should throw.': function providing_a_nonBoolean_value_should_throw() {
_assert["default"]["throws"](function () {

@@ -150,3 +150,3 @@ var graph = new Graph({

type: {
'providing an invalid type should throw.': function providingAnInvalidTypeShouldThrow() {
'providing an invalid type should throw.': function providing_an_invalid_type_should_throw() {
_assert["default"]["throws"](function () {

@@ -161,3 +161,3 @@ var graph = new Graph({

Constructors: {
'all alternative constructors should be available.': function allAlternativeConstructorsShouldBeAvailable() {
'all alternative constructors should be available.': function all_alternative_constructors_should_be_available() {
CONSTRUCTORS.forEach(function (name) {

@@ -167,3 +167,3 @@ return (0, _assert["default"])(name in implementation);

},
'alternative constructors should have the correct options.': function alternativeConstructorsShouldHaveTheCorrectOptions() {
'alternative constructors should have the correct options.': function alternative_constructors_should_have_the_correct_options() {
CONSTRUCTORS.forEach(function (name, index) {

@@ -178,3 +178,3 @@ var graph = new implementation[name]();

},
'alternative constructors should throw if given inconsistent options.': function alternativeConstructorsShouldThrowIfGivenInconsistentOptions() {
'alternative constructors should throw if given inconsistent options.': function alternative_constructors_should_throw_if_given_inconsistent_options() {
CONSTRUCTORS.forEach(function (name, index) {

@@ -181,0 +181,0 @@ var _OPTIONS$index2 = OPTIONS[index],

@@ -8,7 +8,14 @@ "use strict";

var _assert = _interopRequireDefault(require("assert"));
var _take = _interopRequireDefault(require("obliterator/take"));
var _map = _interopRequireDefault(require("obliterator/map"));
var _utils = require("../../src/utils");
var _helpers = require("../helpers");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
* Graphology Edges Iteration Specs
* =================================
*
* Testing the edges iteration-related methods of the graph.
*/
var METHODS = ['edges', 'inEdges', 'outEdges', 'inboundEdges', 'outboundEdges', 'directedEdges', 'undirectedEdges'];

@@ -128,3 +135,3 @@ function edgesIteration(Graph, checkers) {

return _defineProperty({}, '#.' + name, {
'it should throw if too many arguments are provided.': function itShouldThrowIfTooManyArgumentsAreProvided() {
'it should throw if too many arguments are provided.': function it_should_throw_if_too_many_arguments_are_provided() {
_assert["default"]["throws"](function () {

@@ -134,3 +141,3 @@ graph[name](1, 2, 3);

},
'it should throw when the node is not found.': function itShouldThrowWhenTheNodeIsNotFound() {
'it should throw when the node is not found.': function it_should_throw_when_the_node_is_not_found() {
_assert["default"]["throws"](function () {

@@ -140,3 +147,3 @@ graph[name]('Test');

},
'it should throw if either source or target is not found.': function itShouldThrowIfEitherSourceOrTargetIsNotFound() {
'it should throw if either source or target is not found.': function it_should_throw_if_either_source_or_target_is_not_found() {
_assert["default"]["throws"](function () {

@@ -152,3 +159,2 @@ graph[name]('Test', 'Alone');

function specificTests(name, data) {
var _ref2;
var capitalized = name[0].toUpperCase() + name.slice(1, -1);

@@ -163,8 +169,8 @@ var iteratorName = name.slice(0, -1) + 'Entries';

var everyName = 'every' + capitalized;
return _ref2 = {}, _defineProperty(_ref2, '#.' + name, {
'it should return all the relevant edges.': function itShouldReturnAllTheRelevantEdges() {
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, '#.' + name, {
'it should return all the relevant edges.': function it_should_return_all_the_relevant_edges() {
var edges = graph[name]().sort();
_assert["default"].deepStrictEqual(edges, data.all.slice().sort());
},
"it should return a node's relevant edges.": function itShouldReturnANodeSRelevantEdges() {
"it should return a node's relevant edges.": function it_should_return_a_nodeS_relevant_edges() {
var edges = graph[name](data.node.key);

@@ -174,3 +180,3 @@ _assert["default"].deepStrictEqual(edges, data.node.edges);

},
'it should return all the relevant edges between source & target.': function itShouldReturnAllTheRelevantEdgesBetweenSourceTarget() {
'it should return all the relevant edges between source & target.': function it_should_return_all_the_relevant_edges_between_source__target() {
var edges = graph[name](data.path.source, data.path.target);

@@ -180,4 +186,4 @@ (0, _assert["default"])((0, _helpers.sameMembers)(edges, data.path.edges));

}
}), _defineProperty(_ref2, '#.' + forEachName, {
'it should possible to use callback iterators.': function itShouldPossibleToUseCallbackIterators() {
}), '#.' + forEachName, {
'it should possible to use callback iterators.': function it_should_possible_to_use_callback_iterators() {
var edges = [];

@@ -198,3 +204,3 @@ graph[forEachName](function (key, attributes, source, target, sA, tA, u) {

},
"it should be possible to use callback iterators over a node's relevant edges.": function itShouldBePossibleToUseCallbackIteratorsOverANodeSRelevantEdges() {
"it should be possible to use callback iterators over a node's relevant edges.": function it_should_be_possible_to_use_callback_iterators_over_a_nodeS_relevant_edges() {
var edges = [];

@@ -215,3 +221,3 @@ graph[forEachName](data.node.key, function (key, attributes, source, target, sA, tA, u) {

},
'it should be possible to use callback iterators over all the relevant edges between source & target.': function itShouldBePossibleToUseCallbackIteratorsOverAllTheRelevantEdgesBetweenSourceTarget() {
'it should be possible to use callback iterators over all the relevant edges between source & target.': function it_should_be_possible_to_use_callback_iterators_over_all_the_relevant_edges_between_source__target() {
var edges = [];

@@ -231,4 +237,4 @@ graph[forEachName](data.path.source, data.path.target, function (key, attributes, source, target, sA, tA, u) {

}
}), _defineProperty(_ref2, '#.' + mapName, {
'it should possible to map edges.': function itShouldPossibleToMapEdges() {
}), '#.' + mapName, {
'it should possible to map edges.': function it_should_possible_to_map_edges() {
var result = graph[mapName](function (key) {

@@ -240,3 +246,3 @@ return key;

},
"it should be possible to map a node's relevant edges.": function itShouldBePossibleToMapANodeSRelevantEdges() {
"it should be possible to map a node's relevant edges.": function it_should_be_possible_to_map_a_nodeS_relevant_edges() {
var result = graph[mapName](data.node.key, function (key) {

@@ -248,3 +254,3 @@ return key;

},
'it should be possible to map the relevant edges between source & target.': function itShouldBePossibleToMapTheRelevantEdgesBetweenSourceTarget() {
'it should be possible to map the relevant edges between source & target.': function it_should_be_possible_to_map_the_relevant_edges_between_source__target() {
var result = graph[mapName](data.path.source, data.path.target, function (key) {

@@ -256,4 +262,4 @@ return key;

}
}), _defineProperty(_ref2, '#.' + filterName, {
'it should possible to filter edges.': function itShouldPossibleToFilterEdges() {
}), '#.' + filterName, {
'it should possible to filter edges.': function it_should_possible_to_filter_edges() {
var result = graph[filterName](function (key) {

@@ -265,3 +271,3 @@ return data.all.includes(key);

},
"it should be possible to filter a node's relevant edges.": function itShouldBePossibleToFilterANodeSRelevantEdges() {
"it should be possible to filter a node's relevant edges.": function it_should_be_possible_to_filter_a_nodeS_relevant_edges() {
var result = graph[filterName](data.node.key, function (key) {

@@ -273,3 +279,3 @@ return data.all.includes(key);

},
'it should be possible to filter the relevant edges between source & target.': function itShouldBePossibleToFilterTheRelevantEdgesBetweenSourceTarget() {
'it should be possible to filter the relevant edges between source & target.': function it_should_be_possible_to_filter_the_relevant_edges_between_source__target() {
var result = graph[filterName](data.path.source, data.path.target, function (key) {

@@ -281,4 +287,4 @@ return data.all.includes(key);

}
}), _defineProperty(_ref2, '#.' + reduceName, {
'it should throw when given bad arguments.': function itShouldThrowWhenGivenBadArguments() {
}), '#.' + reduceName, {
'it should throw when given bad arguments.': function it_should_throw_when_given_bad_arguments() {
_assert["default"]["throws"](function () {

@@ -299,3 +305,3 @@ graph[reduceName]('test');

},
'it should possible to reduce edges.': function itShouldPossibleToReduceEdges() {
'it should possible to reduce edges.': function it_should_possible_to_reduce_edges() {
var result = graph[reduceName](function (x) {

@@ -306,3 +312,3 @@ return x + 1;

},
"it should be possible to reduce a node's relevant edges.": function itShouldBePossibleToReduceANodeSRelevantEdges() {
"it should be possible to reduce a node's relevant edges.": function it_should_be_possible_to_reduce_a_nodeS_relevant_edges() {
var result = graph[reduceName](data.node.key, function (x) {

@@ -313,3 +319,3 @@ return x + 1;

},
'it should be possible to reduce the relevant edges between source & target.': function itShouldBePossibleToReduceTheRelevantEdgesBetweenSourceTarget() {
'it should be possible to reduce the relevant edges between source & target.': function it_should_be_possible_to_reduce_the_relevant_edges_between_source__target() {
var result = graph[reduceName](data.path.source, data.path.target, function (x) {

@@ -320,4 +326,4 @@ return x + 1;

}
}), _defineProperty(_ref2, '#.' + findName, {
'it should possible to find an edge.': function itShouldPossibleToFindAnEdge() {
}), '#.' + findName, {
'it should possible to find an edge.': function it_should_possible_to_find_an_edge() {
var edges = [];

@@ -343,3 +349,3 @@ var found = graph[findName](function (key, attributes, source, target, sA, tA, u) {

},
"it should be possible to find a node's edge.": function itShouldBePossibleToFindANodeSEdge() {
"it should be possible to find a node's edge.": function it_should_be_possible_to_find_a_nodeS_edge() {
var edges = [];

@@ -365,3 +371,3 @@ var found = graph[findName](data.node.key, function (key, attributes, source, target, sA, tA, u) {

},
'it should be possible to find an edge between source & target.': function itShouldBePossibleToFindAnEdgeBetweenSourceTarget() {
'it should be possible to find an edge between source & target.': function it_should_be_possible_to_find_an_edge_between_source__target() {
var edges = [];

@@ -387,4 +393,4 @@ var found = graph[findName](data.path.source, data.path.target, function (key, attributes, source, target, sA, tA, u) {

}
}), _defineProperty(_ref2, '#.' + someName, {
'it should possible to assert whether any edge matches a predicate.': function itShouldPossibleToAssertWhetherAnyEdgeMatchesAPredicate() {
}), '#.' + someName, {
'it should possible to assert whether any edge matches a predicate.': function it_should_possible_to_assert_whether_any_edge_matches_a_predicate() {
var edges = [];

@@ -410,3 +416,3 @@ var found = graph[someName](function (key, attributes, source, target, sA, tA, u) {

},
"it should possible to assert whether any node's edge matches a predicate.": function itShouldPossibleToAssertWhetherAnyNodeSEdgeMatchesAPredicate() {
"it should possible to assert whether any node's edge matches a predicate.": function it_should_possible_to_assert_whether_any_nodeS_edge_matches_a_predicate() {
var edges = [];

@@ -432,3 +438,3 @@ var found = graph[someName](data.node.key, function (key, attributes, source, target, sA, tA, u) {

},
'it should possible to assert whether any edge between source & target matches a predicate.': function itShouldPossibleToAssertWhetherAnyEdgeBetweenSourceTargetMatchesAPredicate() {
'it should possible to assert whether any edge between source & target matches a predicate.': function it_should_possible_to_assert_whether_any_edge_between_source__target_matches_a_predicate() {
var edges = [];

@@ -454,3 +460,3 @@ var found = graph[someName](data.path.source, data.path.target, function (key, attributes, source, target, sA, tA, u) {

},
'it should always return false on empty sets.': function itShouldAlwaysReturnFalseOnEmptySets() {
'it should always return false on empty sets.': function it_should_always_return_false_on_empty_sets() {
var empty = new Graph();

@@ -461,4 +467,4 @@ _assert["default"].strictEqual(empty[someName](function () {

}
}), _defineProperty(_ref2, '#.' + everyName, {
'it should possible to assert whether all edges matches a predicate.': function itShouldPossibleToAssertWhetherAllEdgesMatchesAPredicate() {
}), '#.' + everyName, {
'it should possible to assert whether all edges matches a predicate.': function it_should_possible_to_assert_whether_all_edges_matches_a_predicate() {
var edges = [];

@@ -483,3 +489,3 @@ var found = graph[everyName](function (key, attributes, source, target, sA, tA, u) {

},
"it should possible to assert whether all of a node's edges matches a predicate.": function itShouldPossibleToAssertWhetherAllOfANodeSEdgesMatchesAPredicate() {
"it should possible to assert whether all of a node's edges matches a predicate.": function it_should_possible_to_assert_whether_all_of_a_nodeS_edges_matches_a_predicate() {
var edges = [];

@@ -504,3 +510,3 @@ var found = graph[everyName](data.node.key, function (key, attributes, source, target, sA, tA, u) {

},
'it should possible to assert whether all edges between source & target matches a predicate.': function itShouldPossibleToAssertWhetherAllEdgesBetweenSourceTargetMatchesAPredicate() {
'it should possible to assert whether all edges between source & target matches a predicate.': function it_should_possible_to_assert_whether_all_edges_between_source__target_matches_a_predicate() {
var edges = [];

@@ -526,3 +532,3 @@ var found = graph[everyName](data.path.source, data.path.target, function (key, attributes, source, target, sA, tA, u) {

},
'it should always return true on empty sets.': function itShouldAlwaysReturnTrueOnEmptySets() {
'it should always return true on empty sets.': function it_should_always_return_true_on_empty_sets() {
var empty = new Graph();

@@ -533,6 +539,6 @@ _assert["default"].strictEqual(empty[everyName](function () {

}
}), _defineProperty(_ref2, '#.' + iteratorName, {
'it should be possible to return an iterator over the relevant edges.': function itShouldBePossibleToReturnAnIteratorOverTheRelevantEdges() {
}), '#.' + iteratorName, {
'it should be possible to return an iterator over the relevant edges.': function it_should_be_possible_to_return_an_iterator_over_the_relevant_edges() {
var iterator = graph[iteratorName]();
_assert["default"].deepStrictEqual((0, _take["default"])(iterator), data.all.map(function (edge) {
_assert["default"].deepStrictEqual(Array.from(iterator), data.all.map(function (edge) {
var _graph$extremities = graph.extremities(edge),

@@ -552,5 +558,5 @@ source = _graph$extremities[0],

},
"it should be possible to return an iterator over a node's relevant edges.": function itShouldBePossibleToReturnAnIteratorOverANodeSRelevantEdges() {
"it should be possible to return an iterator over a node's relevant edges.": function it_should_be_possible_to_return_an_iterator_over_a_nodeS_relevant_edges() {
var iterator = graph[iteratorName](data.node.key);
_assert["default"].deepStrictEqual((0, _take["default"])(iterator), data.node.edges.map(function (edge) {
_assert["default"].deepStrictEqual(Array.from(iterator), data.node.edges.map(function (edge) {
var _graph$extremities2 = graph.extremities(edge),

@@ -570,5 +576,5 @@ source = _graph$extremities2[0],

},
'it should be possible to return an iterator over relevant edges between source & target.': function itShouldBePossibleToReturnAnIteratorOverRelevantEdgesBetweenSourceTarget() {
'it should be possible to return an iterator over relevant edges between source & target.': function it_should_be_possible_to_return_an_iterator_over_relevant_edges_between_source__target() {
var iterator = graph[iteratorName](data.path.source, data.path.target);
_assert["default"].deepStrictEqual((0, _take["default"])(iterator), data.path.edges.map(function (edge) {
_assert["default"].deepStrictEqual(Array.from(iterator), data.path.edges.map(function (edge) {
var _graph$extremities3 = graph.extremities(edge),

@@ -588,7 +594,7 @@ source = _graph$extremities3[0],

}
}), _ref2;
});
}
var tests = {
Miscellaneous: {
'simple graph indices should work.': function simpleGraphIndicesShouldWork() {
'simple graph indices should work.': function simple_graph_indices_should_work() {
var simpleGraph = new Graph();

@@ -601,3 +607,3 @@ (0, _helpers.addNodesFrom)(simpleGraph, [1, 2, 3, 4]);

},
'it should also work with typed graphs.': function itShouldAlsoWorkWithTypedGraphs() {
'it should also work with typed graphs.': function it_should_also_work_with_typed_graphs() {
var undirected = new Graph({

@@ -614,3 +620,3 @@ type: 'undirected'

},
'self loops should appear when using #.inEdges and should appear only once with #.edges.': function selfLoopsShouldAppearWhenUsingInEdgesAndShouldAppearOnlyOnceWithEdges() {
'self loops should appear when using #.inEdges and should appear only once with #.edges.': function self_loops_should_appear_when_using_InEdges_and_should_appear_only_once_with_Edges() {
var directed = new Graph({

@@ -640,3 +646,3 @@ type: 'directed'

},
'it should be possible to retrieve self loops.': function itShouldBePossibleToRetrieveSelfLoops() {
'it should be possible to retrieve self loops.': function it_should_be_possible_to_retrieve_self_loops() {
var loopy = new Graph();

@@ -660,3 +666,3 @@ loopy.addNode('John');

},
'self loops in multi graphs should work properly (#352).': function selfLoopsInMultiGraphsShouldWorkProperly352() {
'self loops in multi graphs should work properly (#352).': function self_loops_in_multi_graphs_should_work_properly_352() {
var loopy = new Graph({

@@ -688,3 +694,3 @@ multi: true

var mapKeys = function mapKeys(it) {
return (0, _take["default"])((0, _map["default"])(it, function (e) {
return Array.from((0, _utils.map)(it, function (e) {
return e.edge;

@@ -708,3 +714,3 @@ }));

},
'findOutboundEdge should work on multigraphs (#319).': function findOutboundEdgeShouldWorkOnMultigraphs319() {
'findOutboundEdge should work on multigraphs (#319).': function findOutboundEdge_should_work_on_multigraphs_319() {
var loopy = new Graph({

@@ -734,6 +740,4 @@ multi: true

// Specific tests
for (var name in TEST_DATA) {
(0, _helpers.deepMerge)(tests, specificTests(name, TEST_DATA[name]));
}
for (var name in TEST_DATA) (0, _helpers.deepMerge)(tests, specificTests(name, TEST_DATA[name]));
return tests;
}

@@ -11,3 +11,3 @@ "use strict";

var _neighbors = _interopRequireDefault(require("./neighbors"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
/**

@@ -24,3 +24,3 @@ * Graphology Iteration Specs

'#.forEachAdjacencyEntry': {
'it should iterate over the relevant elements.': function itShouldIterateOverTheRelevantElements() {
'it should iterate over the relevant elements.': function it_should_iterate_over_the_relevant_elements() {
function test(multi) {

@@ -84,3 +84,3 @@ var graph = new Graph({

'#.forEachAssymetricAdjacencyEntry': {
'it should iterate over the relevant elements.': function itShouldIterateOverTheRelevantElements() {
'it should iterate over the relevant elements.': function it_should_iterate_over_the_relevant_elements() {
function test(multi) {

@@ -87,0 +87,0 @@ var graph = new Graph({

@@ -8,6 +8,13 @@ "use strict";

var _assert = _interopRequireDefault(require("assert"));
var _take = _interopRequireDefault(require("obliterator/take"));
var _helpers = require("../helpers");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
* Graphology Edges Iteration Specs
* =================================
*
* Testing the edges iteration-related methods of the graph.
*/
var METHODS = ['neighbors', 'inNeighbors', 'outNeighbors', 'inboundNeighbors', 'outboundNeighbors', 'directedNeighbors', 'undirectedNeighbors'];

@@ -80,3 +87,3 @@ function neighborsIteration(Graph, checkers) {

return _defineProperty({}, '#.' + name, {
'it should throw when the node is not found.': function itShouldThrowWhenTheNodeIsNotFound() {
'it should throw when the node is not found.': function it_should_throw_when_the_node_is_not_found() {
_assert["default"]["throws"](function () {

@@ -93,3 +100,2 @@ graph[name]('Test');

function specificTests(name, data) {
var _ref2;
var capitalized = name[0].toUpperCase() + name.slice(1, -1);

@@ -105,4 +111,4 @@ var forEachName = 'forEach' + capitalized;

var everyName = 'every' + capitalized;
return _ref2 = {}, _defineProperty(_ref2, '#.' + name, {
'it should return the correct neighbors array.': function itShouldReturnTheCorrectNeighborsArray() {
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, '#.' + name, {
'it should return the correct neighbors array.': function it_should_return_the_correct_neighbors_array() {
var neighbors = graph[name](data.node.key);

@@ -112,4 +118,4 @@ _assert["default"].deepStrictEqual(neighbors, data.node.neighbors);

}
}), _defineProperty(_ref2, '#.' + forEachName, {
'it should be possible to iterate over neighbors using a callback.': function itShouldBePossibleToIterateOverNeighborsUsingACallback() {
}), '#.' + forEachName, {
'it should be possible to iterate over neighbors using a callback.': function it_should_be_possible_to_iterate_over_neighbors_using_a_callback() {
var neighbors = [];

@@ -123,4 +129,4 @@ graph[forEachName](data.node.key, function (target, attrs) {

}
}), _defineProperty(_ref2, '#.' + mapName, {
'it should be possible to map neighbors using a callback.': function itShouldBePossibleToMapNeighborsUsingACallback() {
}), '#.' + mapName, {
'it should be possible to map neighbors using a callback.': function it_should_be_possible_to_map_neighbors_using_a_callback() {
var result = graph[mapName](data.node.key, function (target) {

@@ -131,4 +137,4 @@ return target;

}
}), _defineProperty(_ref2, '#.' + filterName, {
'it should be possible to filter neighbors using a callback.': function itShouldBePossibleToFilterNeighborsUsingACallback() {
}), '#.' + filterName, {
'it should be possible to filter neighbors using a callback.': function it_should_be_possible_to_filter_neighbors_using_a_callback() {
var result = graph[filterName](data.node.key, function () {

@@ -143,4 +149,4 @@ return true;

}
}), _defineProperty(_ref2, '#.' + reduceName, {
'it sould throw if not given an initial value.': function itSouldThrowIfNotGivenAnInitialValue() {
}), '#.' + reduceName, {
'it sould throw if not given an initial value.': function it_sould_throw_if_not_given_an_initial_value() {
_assert["default"]["throws"](function () {

@@ -152,3 +158,3 @@ graph[reduceName]('node', function () {

},
'it should be possible to reduce neighbors using a callback.': function itShouldBePossibleToReduceNeighborsUsingACallback() {
'it should be possible to reduce neighbors using a callback.': function it_should_be_possible_to_reduce_neighbors_using_a_callback() {
var result = graph[reduceName](data.node.key, function (acc, key) {

@@ -159,4 +165,4 @@ return acc.concat(key);

}
}), _defineProperty(_ref2, '#.' + findName, {
'it should be possible to find neighbors.': function itShouldBePossibleToFindNeighbors() {
}), '#.' + findName, {
'it should be possible to find neighbors.': function it_should_be_possible_to_find_neighbors() {
var neighbors = [];

@@ -176,4 +182,4 @@ var found = graph[findName](data.node.key, function (target, attrs) {

}
}), _defineProperty(_ref2, '#.' + someName, {
'it should always return false on empty set.': function itShouldAlwaysReturnFalseOnEmptySet() {
}), '#.' + someName, {
'it should always return false on empty set.': function it_should_always_return_false_on_empty_set() {
var loneGraph = new Graph();

@@ -185,3 +191,3 @@ loneGraph.addNode('alone');

},
'it should be possible to assert whether any neighbor matches a predicate.': function itShouldBePossibleToAssertWhetherAnyNeighborMatchesAPredicate() {
'it should be possible to assert whether any neighbor matches a predicate.': function it_should_be_possible_to_assert_whether_any_neighbor_matches_a_predicate() {
_assert["default"].strictEqual(graph[someName](data.node.key, function () {

@@ -191,4 +197,4 @@ return true;

}
}), _defineProperty(_ref2, '#.' + everyName, {
'it should always return true on empty set.': function itShouldAlwaysReturnTrueOnEmptySet() {
}), '#.' + everyName, {
'it should always return true on empty set.': function it_should_always_return_true_on_empty_set() {
var loneGraph = new Graph();

@@ -200,3 +206,3 @@ loneGraph.addNode('alone');

},
'it should be possible to assert whether any neighbor matches a predicate.': function itShouldBePossibleToAssertWhetherAnyNeighborMatchesAPredicate() {
'it should be possible to assert whether any neighbor matches a predicate.': function it_should_be_possible_to_assert_whether_any_neighbor_matches_a_predicate() {
_assert["default"].strictEqual(graph[everyName](data.node.key, function () {

@@ -206,6 +212,6 @@ return true;

}
}), _defineProperty(_ref2, '#.' + iteratorName, {
'it should be possible to create an iterator over neighbors.': function itShouldBePossibleToCreateAnIteratorOverNeighbors() {
}), '#.' + iteratorName, {
'it should be possible to create an iterator over neighbors.': function it_should_be_possible_to_create_an_iterator_over_neighbors() {
var iterator = graph[iteratorName](data.node.key);
_assert["default"].deepStrictEqual((0, _take["default"])(iterator), data.node.neighbors.map(function (neighbor) {
_assert["default"].deepStrictEqual(Array.from(iterator), data.node.neighbors.map(function (neighbor) {
return {

@@ -217,7 +223,7 @@ neighbor: neighbor,

}
}), _ref2;
});
}
var tests = {
Miscellaneous: {
'self loops should appear when using #.inNeighbors and should appear only once with #.neighbors.': function selfLoopsShouldAppearWhenUsingInNeighborsAndShouldAppearOnlyOnceWithNeighbors() {
'self loops should appear when using #.inNeighbors and should appear only once with #.neighbors.': function self_loops_should_appear_when_using_InNeighbors_and_should_appear_only_once_with_Neighbors() {
var directed = new Graph({

@@ -256,6 +262,4 @@ type: 'directed'

// Specific tests
for (var name in TEST_DATA) {
(0, _helpers.deepMerge)(tests, specificTests(name, TEST_DATA[name]));
}
for (var name in TEST_DATA) (0, _helpers.deepMerge)(tests, specificTests(name, TEST_DATA[name]));
return tests;
}

@@ -9,3 +9,3 @@ "use strict";

var _helpers = require("../helpers");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
/**

@@ -22,3 +22,3 @@ * Graphology Nodes Iteration Specs

'#.nodes': {
'it should return the list of nodes of the graph.': function itShouldReturnTheListOfNodesOfTheGraph() {
'it should return the list of nodes of the graph.': function it_should_return_the_list_of_nodes_of_the_graph() {
var graph = new Graph();

@@ -30,3 +30,3 @@ (0, _helpers.addNodesFrom)(graph, ['one', 'two', 'three']);

'#.forEachNode': {
'it should throw if given callback is not a function.': function itShouldThrowIfGivenCallbackIsNotAFunction() {
'it should throw if given callback is not a function.': function it_should_throw_if_given_callback_is_not_a_function() {
var graph = new Graph();

@@ -37,3 +37,3 @@ _assert["default"]["throws"](function () {

},
'it should be possible to iterate over nodes and their attributes.': function itShouldBePossibleToIterateOverNodesAndTheirAttributes() {
'it should be possible to iterate over nodes and their attributes.': function it_should_be_possible_to_iterate_over_nodes_and_their_attributes() {
var graph = new Graph();

@@ -60,3 +60,3 @@ graph.addNode('John', {

'#.findNode': {
'it should throw if given callback is not a function.': function itShouldThrowIfGivenCallbackIsNotAFunction() {
'it should throw if given callback is not a function.': function it_should_throw_if_given_callback_is_not_a_function() {
var graph = new Graph();

@@ -67,3 +67,3 @@ _assert["default"]["throws"](function () {

},
'it should be possible to find a node in the graph.': function itShouldBePossibleToFindANodeInTheGraph() {
'it should be possible to find a node in the graph.': function it_should_be_possible_to_find_a_node_in_the_graph() {
var graph = new Graph();

@@ -94,3 +94,3 @@ graph.addNode('John', {

'#.mapNodes': {
'it should be possible to map nodes.': function itShouldBePossibleToMapNodes() {
'it should be possible to map nodes.': function it_should_be_possible_to_map_nodes() {
var graph = new Graph();

@@ -110,3 +110,3 @@ graph.addNode('one', {

'#.someNode': {
'it should always return false on empty sets.': function itShouldAlwaysReturnFalseOnEmptySets() {
'it should always return false on empty sets.': function it_should_always_return_false_on_empty_sets() {
var graph = new Graph();

@@ -117,3 +117,3 @@ _assert["default"].strictEqual(graph.someNode(function () {

},
'it should be possible to find if some node matches a predicate.': function itShouldBePossibleToFindIfSomeNodeMatchesAPredicate() {
'it should be possible to find if some node matches a predicate.': function it_should_be_possible_to_find_if_some_node_matches_a_predicate() {
var graph = new Graph();

@@ -135,3 +135,3 @@ graph.addNode('one', {

'#.everyNode': {
'it should always return true on empty sets.': function itShouldAlwaysReturnTrueOnEmptySets() {
'it should always return true on empty sets.': function it_should_always_return_true_on_empty_sets() {
var graph = new Graph();

@@ -142,3 +142,3 @@ _assert["default"].strictEqual(graph.everyNode(function () {

},
'it should be possible to find if all node matches a predicate.': function itShouldBePossibleToFindIfAllNodeMatchesAPredicate() {
'it should be possible to find if all node matches a predicate.': function it_should_be_possible_to_find_if_all_node_matches_a_predicate() {
var graph = new Graph();

@@ -160,3 +160,3 @@ graph.addNode('one', {

'#.filterNodes': {
'it should be possible to filter nodes.': function itShouldBePossibleToFilterNodes() {
'it should be possible to filter nodes.': function it_should_be_possible_to_filter_nodes() {
var graph = new Graph();

@@ -180,3 +180,3 @@ graph.addNode('one', {

'#.reduceNodes': {
'it should throw if initial value is not given.': function itShouldThrowIfInitialValueIsNotGiven() {
'it should throw if initial value is not given.': function it_should_throw_if_initial_value_is_not_given() {
var graph = new Graph();

@@ -189,3 +189,3 @@ _assert["default"]["throws"](function () {

},
'it should be possible to reduce nodes.': function itShouldBePossibleToReduceNodes() {
'it should be possible to reduce nodes.': function it_should_be_possible_to_reduce_nodes() {
var graph = new Graph();

@@ -208,3 +208,3 @@ graph.addNode('one', {

'#.nodeEntries': {
'it should be possible to create a nodes iterator.': function itShouldBePossibleToCreateANodesIterator() {
'it should be possible to create a nodes iterator.': function it_should_be_possible_to_create_a_nodes_iterator() {
var graph = new Graph();

@@ -211,0 +211,0 @@ (0, _helpers.addNodesFrom)(graph, ['one', 'two', 'three']);

@@ -9,3 +9,3 @@ "use strict";

var _helpers = require("./helpers");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
/**

@@ -21,3 +21,3 @@ * Graphology Known Methods Specs

'#.toJSON': {
'it should return the serialized graph.': function itShouldReturnTheSerializedGraph() {
'it should return the serialized graph.': function it_should_return_the_serialized_graph() {
var graph = new Graph({

@@ -41,3 +41,3 @@ multi: true

'#.toString': {
'it should return "[object Graph]".': function itShouldReturnObjectGraph() {
'it should return "[object Graph]".': function it_should_return_Object_Graph() {
var graph = new Graph();

@@ -44,0 +44,0 @@ _assert["default"].strictEqual(graph.toString(), '[object Graph]');

@@ -9,3 +9,3 @@ "use strict";

var _helpers = require("./helpers");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
/**

@@ -21,3 +21,3 @@ * Graphology Misc Specs

Structure: {
'a simple mixed graph can have A->B, B->A & A<->B': function aSimpleMixedGraphCanHaveABBAAB() {
'a simple mixed graph can have A->B, B->A & A<->B': function a_simple_mixed_graph_can_have_AB_BA__AB() {
var graph = new Graph();

@@ -31,3 +31,3 @@ (0, _helpers.addNodesFrom)(graph, ['Audrey', 'Benjamin']);

},
'deleting the last edge between A & B should correctly clear neighbor index.': function deletingTheLastEdgeBetweenABShouldCorrectlyClearNeighborIndex() {
'deleting the last edge between A & B should correctly clear neighbor index.': function deleting_the_last_edge_between_A__B_should_correctly_clear_neighbor_index() {
var graph = new Graph({

@@ -46,3 +46,3 @@ multi: true

},
'exhaustive deletion use-cases should not break doubly-linked lists implementation of multigraph edge storage.': function exhaustiveDeletionUseCasesShouldNotBreakDoublyLinkedListsImplementationOfMultigraphEdgeStorage() {
'exhaustive deletion use-cases should not break doubly-linked lists implementation of multigraph edge storage.': function exhaustive_deletion_useCases_should_not_break_doublyLinked_lists_implementation_of_multigraph_edge_storage() {
var graph = new Graph({

@@ -78,3 +78,3 @@ multi: true

'Key coercion': {
'keys should be correctly coerced to strings.': function keysShouldBeCorrectlyCoercedToStrings() {
'keys should be correctly coerced to strings.': function keys_should_be_correctly_coerced_to_strings() {
var graph = new Graph();

@@ -81,0 +81,0 @@ graph.addNode(1);

@@ -9,6 +9,14 @@ "use strict";

var _helpers = require("./helpers");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
* Graphology Mutation Specs
* ==========================
*
* Testing the mutation methods of the graph.
*/
function mutation(Graph, checkers) {

@@ -20,3 +28,3 @@ var invalid = checkers.invalid,

'#.addNode': {
'it should throw if given attributes is not an object.': function itShouldThrowIfGivenAttributesIsNotAnObject() {
'it should throw if given attributes is not an object.': function it_should_throw_if_given_attributes_is_not_an_object() {
var graph = new Graph();

@@ -27,3 +35,3 @@ _assert["default"]["throws"](function () {

},
'it should throw if the given node already exist.': function itShouldThrowIfTheGivenNodeAlreadyExist() {
'it should throw if the given node already exist.': function it_should_throw_if_the_given_node_already_exist() {
var graph = new Graph();

@@ -35,3 +43,3 @@ graph.addNode('Martha');

},
'it should return the added node.': function itShouldReturnTheAddedNode() {
'it should return the added node.': function it_should_return_the_added_node() {
var graph = new Graph();

@@ -42,3 +50,3 @@ _assert["default"].strictEqual(graph.addNode('John'), 'John');

'#.mergeNode': {
'it should add the node if it does not exist yet.': function itShouldAddTheNodeIfItDoesNotExistYet() {
'it should add the node if it does not exist yet.': function it_should_add_the_node_if_it_does_not_exist_yet() {
var graph = new Graph();

@@ -48,3 +56,3 @@ graph.mergeNode('John');

},
'it should do nothing if the node already exists.': function itShouldDoNothingIfTheNodeAlreadyExists() {
'it should do nothing if the node already exists.': function it_should_do_nothing_if_the_node_already_exists() {
var graph = new Graph();

@@ -55,3 +63,3 @@ graph.addNode('John');

},
'it should merge the attributes.': function itShouldMergeTheAttributes() {
'it should merge the attributes.': function it_should_merge_the_attributes() {
var graph = new Graph();

@@ -70,3 +78,3 @@ graph.addNode('John', {

},
'it should coerce keys to string.': function itShouldCoerceKeysToString() {
'it should coerce keys to string.': function it_should_coerce_keys_to_string() {
var graph = new Graph();

@@ -78,3 +86,3 @@ graph.addNode(4);

},
'it should return useful information.': function itShouldReturnUsefulInformation() {
'it should return useful information.': function it_should_return_useful_information() {
var graph = new Graph();

@@ -94,3 +102,3 @@ var _graph$mergeNode = graph.mergeNode('Jack'),

'#.updateNode': {
'it should add the node if it does not exist yet.': function itShouldAddTheNodeIfItDoesNotExistYet() {
'it should add the node if it does not exist yet.': function it_should_add_the_node_if_it_does_not_exist_yet() {
var graph = new Graph();

@@ -100,3 +108,3 @@ graph.updateNode('John');

},
'it should do nothing if the node already exists.': function itShouldDoNothingIfTheNodeAlreadyExists() {
'it should do nothing if the node already exists.': function it_should_do_nothing_if_the_node_already_exists() {
var graph = new Graph();

@@ -107,3 +115,3 @@ graph.addNode('John');

},
'it should update the attributes.': function itShouldUpdateTheAttributes() {
'it should update the attributes.': function it_should_update_the_attributes() {
var graph = new Graph();

@@ -125,3 +133,3 @@ graph.addNode('John', {

},
'it should be possible to start from blank attributes.': function itShouldBePossibleToStartFromBlankAttributes() {
'it should be possible to start from blank attributes.': function it_should_be_possible_to_start_from_blank_attributes() {
var graph = new Graph();

@@ -137,3 +145,3 @@ graph.updateNode('John', function () {

},
'it should coerce keys to string.': function itShouldCoerceKeysToString() {
'it should coerce keys to string.': function it_should_coerce_keys_to_string() {
var graph = new Graph();

@@ -145,3 +153,3 @@ graph.addNode(4);

},
'it should return useful information.': function itShouldReturnUsefulInformation() {
'it should return useful information.': function it_should_return_useful_information() {
var graph = new Graph();

@@ -161,3 +169,3 @@ var _graph$updateNode = graph.updateNode('Jack'),

'#.addDirectedEdge': {
'it should throw if given attributes is not an object.': function itShouldThrowIfGivenAttributesIsNotAnObject() {
'it should throw if given attributes is not an object.': function it_should_throw_if_given_attributes_is_not_an_object() {
var graph = new Graph();

@@ -168,3 +176,3 @@ _assert["default"]["throws"](function () {

},
'it should throw if the graph is undirected.': function itShouldThrowIfTheGraphIsUndirected() {
'it should throw if the graph is undirected.': function it_should_throw_if_the_graph_is_undirected() {
var graph = new Graph({

@@ -177,3 +185,3 @@ type: 'undirected'

},
'it should throw if either the source or the target does not exist.': function itShouldThrowIfEitherTheSourceOrTheTargetDoesNotExist() {
'it should throw if either the source or the target does not exist.': function it_should_throw_if_either_the_source_or_the_target_does_not_exist() {
var graph = new Graph();

@@ -188,3 +196,3 @@ graph.addNode('Martha');

},
'it should throw if the edge is a loop and the graph does not allow it.': function itShouldThrowIfTheEdgeIsALoopAndTheGraphDoesNotAllowIt() {
'it should throw if the edge is a loop and the graph does not allow it.': function it_should_throw_if_the_edge_is_a_loop_and_the_graph_does_not_allow_it() {
var graph = new Graph({

@@ -198,3 +206,3 @@ allowSelfLoops: false

},
'it should be possible to add self loops.': function itShouldBePossibleToAddSelfLoops() {
'it should be possible to add self loops.': function it_should_be_possible_to_add_self_loops() {
var graph = new Graph();

@@ -205,3 +213,3 @@ graph.addNode('Thomas');

},
'it should throw if the graph is not multi & we try to add twice the same edge.': function itShouldThrowIfTheGraphIsNotMultiWeTryToAddTwiceTheSameEdge() {
'it should throw if the graph is not multi & we try to add twice the same edge.': function it_should_throw_if_the_graph_is_not_multi__we_try_to_add_twice_the_same_edge() {
var graph = new Graph();

@@ -218,3 +226,3 @@ graph.addNode('Thomas');

},
"it should return the generated edge's key.": function itShouldReturnTheGeneratedEdgeSKey() {
"it should return the generated edge's key.": function it_should_return_the_generated_edgeS_key() {
var graph = new Graph();

@@ -229,3 +237,3 @@ graph.addNode('Thomas');

'#.addEdge': {
'it should add a directed edge if the graph is directed or mixed.': function itShouldAddADirectedEdgeIfTheGraphIsDirectedOrMixed() {
'it should add a directed edge if the graph is directed or mixed.': function it_should_add_a_directed_edge_if_the_graph_is_directed_or_mixed() {
var graph = new Graph(),

@@ -244,3 +252,3 @@ directedGraph = new Graph({

},
'it should add an undirected edge if the graph is undirected.': function itShouldAddAnUndirectedEdgeIfTheGraphIsUndirected() {
'it should add an undirected edge if the graph is undirected.': function it_should_add_an_undirected_edge_if_the_graph_is_undirected() {
var graph = new Graph({

@@ -256,3 +264,3 @@ type: 'undirected'

'#.addDirectedEdgeWithKey': {
'it should throw if an edge with the same key already exists.': function itShouldThrowIfAnEdgeWithTheSameKeyAlreadyExists() {
'it should throw if an edge with the same key already exists.': function it_should_throw_if_an_edge_with_the_same_key_already_exists() {
var graph = new Graph();

@@ -271,3 +279,3 @@ graph.addNode('Thomas');

'#.addUndirectedEdgeWithKey': {
'it should throw if an edge with the same key already exists.': function itShouldThrowIfAnEdgeWithTheSameKeyAlreadyExists() {
'it should throw if an edge with the same key already exists.': function it_should_throw_if_an_edge_with_the_same_key_already_exists() {
var graph = new Graph();

@@ -286,3 +294,3 @@ graph.addNode('Thomas');

'#.addEdgeWithKey': {
'it should add a directed edge if the graph is directed or mixed.': function itShouldAddADirectedEdgeIfTheGraphIsDirectedOrMixed() {
'it should add a directed edge if the graph is directed or mixed.': function it_should_add_a_directed_edge_if_the_graph_is_directed_or_mixed() {
var graph = new Graph(),

@@ -301,3 +309,3 @@ directedGraph = new Graph({

},
'it should add an undirected edge if the graph is undirected.': function itShouldAddAnUndirectedEdgeIfTheGraphIsUndirected() {
'it should add an undirected edge if the graph is undirected.': function it_should_add_an_undirected_edge_if_the_graph_is_undirected() {
var graph = new Graph({

@@ -313,3 +321,3 @@ type: 'undirected'

'#.mergeEdge': {
'it should add the edge if it does not yet exist.': function itShouldAddTheEdgeIfItDoesNotYetExist() {
'it should add the edge if it does not yet exist.': function it_should_add_the_edge_if_it_does_not_yet_exist() {
var graph = new Graph();

@@ -321,3 +329,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Martha']);

},
'it should do nothing if the edge already exists.': function itShouldDoNothingIfTheEdgeAlreadyExists() {
'it should do nothing if the edge already exists.': function it_should_do_nothing_if_the_edge_already_exists() {
var graph = new Graph();

@@ -330,3 +338,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Martha']);

},
'it should merge existing attributes if any.': function itShouldMergeExistingAttributesIfAny() {
'it should merge existing attributes if any.': function it_should_merge_existing_attributes_if_any() {
var graph = new Graph();

@@ -347,3 +355,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Martha']);

},
'it should add missing nodes in the path.': function itShouldAddMissingNodesInThePath() {
'it should add missing nodes in the path.': function it_should_add_missing_nodes_in_the_path() {
var graph = new Graph();

@@ -355,3 +363,3 @@ graph.mergeEdge('John', 'Martha');

},
'it should throw in case of inconsistencies.': function itShouldThrowInCaseOfInconsistencies() {
'it should throw in case of inconsistencies.': function it_should_throw_in_case_of_inconsistencies() {
var graph = new Graph();

@@ -363,3 +371,3 @@ graph.mergeEdgeWithKey('J->M', 'John', 'Martha');

},
'it should be able to merge undirected edges in both directions.': function itShouldBeAbleToMergeUndirectedEdgesInBothDirections() {
'it should be able to merge undirected edges in both directions.': function it_should_be_able_to_merge_undirected_edges_in_both_directions() {
_assert["default"].doesNotThrow(function () {

@@ -372,3 +380,3 @@ var graph = new Graph();

},
'it should distinguish between typed edges.': function itShouldDistinguishBetweenTypedEdges() {
'it should distinguish between typed edges.': function it_should_distinguish_between_typed_edges() {
var graph = new Graph();

@@ -383,3 +391,3 @@ graph.mergeEdge('John', 'Martha', {

},
'it should be possible to merge a self loop.': function itShouldBePossibleToMergeASelfLoop() {
'it should be possible to merge a self loop.': function it_should_be_possible_to_merge_a_self_loop() {
var graph = new Graph();

@@ -392,3 +400,3 @@ graph.mergeEdge('John', 'John', {

},
'it should return useful information.': function itShouldReturnUsefulInformation() {
'it should return useful information.': function it_should_return_useful_information() {
var graph = new Graph();

@@ -410,3 +418,3 @@ var info = graph.mergeEdge('John', 'Jack');

'#.updateEdge': {
'it should add the edge if it does not yet exist.': function itShouldAddTheEdgeIfItDoesNotYetExist() {
'it should add the edge if it does not yet exist.': function it_should_add_the_edge_if_it_does_not_yet_exist() {
var graph = new Graph();

@@ -418,3 +426,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Martha']);

},
'it should do nothing if the edge already exists.': function itShouldDoNothingIfTheEdgeAlreadyExists() {
'it should do nothing if the edge already exists.': function it_should_do_nothing_if_the_edge_already_exists() {
var graph = new Graph();

@@ -427,3 +435,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Martha']);

},
'it should be possible to start from blank attributes.': function itShouldBePossibleToStartFromBlankAttributes() {
'it should be possible to start from blank attributes.': function it_should_be_possible_to_start_from_blank_attributes() {
var graph = new Graph();

@@ -442,3 +450,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Martha']);

},
'it should update existing attributes if any.': function itShouldUpdateExistingAttributesIfAny() {
'it should update existing attributes if any.': function it_should_update_existing_attributes_if_any() {
var graph = new Graph();

@@ -461,3 +469,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Martha']);

},
'it should add missing nodes in the path.': function itShouldAddMissingNodesInThePath() {
'it should add missing nodes in the path.': function it_should_add_missing_nodes_in_the_path() {
var graph = new Graph();

@@ -469,3 +477,3 @@ graph.updateEdge('John', 'Martha');

},
'it should throw in case of inconsistencies.': function itShouldThrowInCaseOfInconsistencies() {
'it should throw in case of inconsistencies.': function it_should_throw_in_case_of_inconsistencies() {
var graph = new Graph();

@@ -477,3 +485,3 @@ graph.updateEdgeWithKey('J->M', 'John', 'Martha');

},
'it should distinguish between typed edges.': function itShouldDistinguishBetweenTypedEdges() {
'it should distinguish between typed edges.': function it_should_distinguish_between_typed_edges() {
var graph = new Graph();

@@ -492,3 +500,3 @@ graph.updateEdge('John', 'Martha', function () {

},
'it should be possible to merge a self loop.': function itShouldBePossibleToMergeASelfLoop() {
'it should be possible to merge a self loop.': function it_should_be_possible_to_merge_a_self_loop() {
var graph = new Graph();

@@ -503,3 +511,3 @@ graph.updateEdge('John', 'John', function () {

},
'it should return useful information.': function itShouldReturnUsefulInformation() {
'it should return useful information.': function it_should_return_useful_information() {
var graph = new Graph();

@@ -521,3 +529,3 @@ var info = graph.updateEdge('John', 'Jack');

'#.dropEdge': {
'it should throw if the edge or nodes in the path are not found in the graph.': function itShouldThrowIfTheEdgeOrNodesInThePathAreNotFoundInTheGraph() {
'it should throw if the edge or nodes in the path are not found in the graph.': function it_should_throw_if_the_edge_or_nodes_in_the_path_are_not_found_in_the_graph() {
var graph = new Graph();

@@ -538,3 +546,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Martha']);

},
'it should correctly remove the given edge from the graph.': function itShouldCorrectlyRemoveTheGivenEdgeFromTheGraph() {
'it should correctly remove the given edge from the graph.': function it_should_correctly_remove_the_given_edge_from_the_graph() {
var graph = new Graph();

@@ -551,3 +559,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Margaret']);

},
'it should be possible to remove an edge using source & target.': function itShouldBePossibleToRemoveAnEdgeUsingSourceTarget() {
'it should be possible to remove an edge using source & target.': function it_should_be_possible_to_remove_an_edge_using_source__target() {
var graph = new Graph();

@@ -564,3 +572,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Margaret']);

},
'it should work with self loops.': function itShouldWorkWithSelfLoops() {
'it should work with self loops.': function it_should_work_with_self_loops() {
var graph = new Graph();

@@ -584,3 +592,3 @@ graph.mergeEdge('John', 'John');

'#.dropNode': {
'it should throw if the edge is not found in the graph.': function itShouldThrowIfTheEdgeIsNotFoundInTheGraph() {
'it should throw if the edge is not found in the graph.': function it_should_throw_if_the_edge_is_not_found_in_the_graph() {
var graph = new Graph();

@@ -591,3 +599,3 @@ _assert["default"]["throws"](function () {

},
'it should correctly remove the given node from the graph.': function itShouldCorrectlyRemoveTheGivenNodeFromTheGraph() {
'it should correctly remove the given node from the graph.': function it_should_correctly_remove_the_given_node_from_the_graph() {
var graph = new Graph();

@@ -605,3 +613,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Margaret']);

},
'it should also work with mixed, multi graphs and self loops.': function itShouldAlsoWorkWithMixedMultiGraphsAndSelfLoops() {
'it should also work with mixed, multi graphs and self loops.': function it_should_also_work_with_mixed_multi_graphs_and_self_loops() {
var graph = new Graph({

@@ -628,3 +636,3 @@ multi: true

},
'it should also coerce keys as strings.': function itShouldAlsoCoerceKeysAsStrings() {
'it should also coerce keys as strings.': function it_should_also_coerce_keys_as_strings() {
function Key(name) {

@@ -645,3 +653,3 @@ this.name = name;

'#.dropDirectedEdge': {
'it should throw if given incorrect arguments.': function itShouldThrowIfGivenIncorrectArguments() {
'it should throw if given incorrect arguments.': function it_should_throw_if_given_incorrect_arguments() {
_assert["default"]["throws"](function () {

@@ -666,3 +674,3 @@ var graph = new Graph({

},
'it should correctly drop the relevant edge.': function itShouldCorrectlyDropTheRelevantEdge() {
'it should correctly drop the relevant edge.': function it_should_correctly_drop_the_relevant_edge() {
var graph = new Graph();

@@ -678,3 +686,3 @@ graph.mergeUndirectedEdge('a', 'b');

'#.dropUndirectedEdge': {
'it should throw if given incorrect arguments.': function itShouldThrowIfGivenIncorrectArguments() {
'it should throw if given incorrect arguments.': function it_should_throw_if_given_incorrect_arguments() {
_assert["default"]["throws"](function () {

@@ -703,3 +711,3 @@ var graph = new Graph({

},
'it should correctly drop the relevant edge.': function itShouldCorrectlyDropTheRelevantEdge() {
'it should correctly drop the relevant edge.': function it_should_correctly_drop_the_relevant_edge() {
var graph = new Graph();

@@ -715,3 +723,3 @@ graph.mergeUndirectedEdge('a', 'b');

'#.clear': {
'it should empty the graph.': function itShouldEmptyTheGraph() {
'it should empty the graph.': function it_should_empty_the_graph() {
var graph = new Graph();

@@ -727,3 +735,3 @@ (0, _helpers.addNodesFrom)(graph, ['Lindsay', 'Martha']);

},
'it should be possible to use the graph normally afterwards.': function itShouldBePossibleToUseTheGraphNormallyAfterwards() {
'it should be possible to use the graph normally afterwards.': function it_should_be_possible_to_use_the_graph_normally_afterwards() {
var graph = new Graph();

@@ -743,3 +751,3 @@ (0, _helpers.addNodesFrom)(graph, ['Lindsay', 'Martha']);

'#.clearEdges': {
'it should drop every edge from the graph.': function itShouldDropEveryEdgeFromTheGraph() {
'it should drop every edge from the graph.': function it_should_drop_every_edge_from_the_graph() {
var graph = new Graph();

@@ -755,3 +763,3 @@ (0, _helpers.addNodesFrom)(graph, ['Lindsay', 'Martha']);

},
'it should properly reset instance counters.': function itShouldProperlyResetInstanceCounters() {
'it should properly reset instance counters.': function it_should_properly_reset_instance_counters() {
var graph = new Graph();

@@ -766,3 +774,3 @@ graph.mergeEdge(0, 1);

},
'it should properly clear node indices, regarding self loops notably.': function itShouldProperlyClearNodeIndicesRegardingSelfLoopsNotably() {
'it should properly clear node indices, regarding self loops notably.': function it_should_properly_clear_node_indices_regarding_self_loops_notably() {
var graph = new Graph();

@@ -769,0 +777,0 @@ graph.mergeEdge(1, 1);

@@ -8,4 +8,9 @@ "use strict";

var _assert = _interopRequireDefault(require("assert"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } /**
* Graphology Properties Specs
* ============================
*
* Testing the properties of the graph.
*/
var PROPERTIES = ['order', 'size', 'directedSize', 'undirectedSize', 'type', 'multi', 'allowSelfLoops', 'implementation', 'selfLoopCount', 'directedSelfLoopCount', 'undirectedSelfLoopCount'];

@@ -18,3 +23,3 @@ function properties(Graph) {

misc: {
'all expected properties should be set.': function allExpectedPropertiesShouldBeSet() {
'all expected properties should be set.': function all_expected_properties_should_be_set() {
var graph = new Graph();

@@ -25,3 +30,3 @@ PROPERTIES.forEach(function (property) {

},
'properties should be read-only.': function propertiesShouldBeReadOnly() {
'properties should be read-only.': function properties_should_be_readOnly() {
var graph = new Graph();

@@ -41,7 +46,7 @@

'#.order': {
'it should be 0 if the graph is empty.': function itShouldBe0IfTheGraphIsEmpty() {
'it should be 0 if the graph is empty.': function it_should_be_0_if_the_graph_is_empty() {
var graph = new Graph();
_assert["default"].strictEqual(graph.order, 0);
},
'adding nodes should increase order.': function addingNodesShouldIncreaseOrder() {
'adding nodes should increase order.': function adding_nodes_should_increase_order() {
var graph = new Graph();

@@ -57,7 +62,7 @@ graph.addNode('John');

'#.size': {
'it should be 0 if the graph is empty.': function itShouldBe0IfTheGraphIsEmpty() {
'it should be 0 if the graph is empty.': function it_should_be_0_if_the_graph_is_empty() {
var graph = new Graph();
_assert["default"].strictEqual(graph.size, 0);
},
'adding & dropping edges should affect size.': function addingDroppingEdgesShouldAffectSize() {
'adding & dropping edges should affect size.': function adding__dropping_edges_should_affect_size() {
var graph = new Graph();

@@ -76,7 +81,7 @@ graph.addNode('John');

'#.directedSize': {
'it should be 0 if the graph is empty.': function itShouldBe0IfTheGraphIsEmpty() {
'it should be 0 if the graph is empty.': function it_should_be_0_if_the_graph_is_empty() {
var graph = new Graph();
_assert["default"].strictEqual(graph.directedSize, 0);
},
'adding & dropping edges should affect directed size.': function addingDroppingEdgesShouldAffectDirectedSize() {
'adding & dropping edges should affect directed size.': function adding__dropping_edges_should_affect_directed_size() {
var graph = new Graph();

@@ -99,7 +104,7 @@ graph.addNode('John');

'#.undirectedSize': {
'it should be 0 if the graph is empty.': function itShouldBe0IfTheGraphIsEmpty() {
'it should be 0 if the graph is empty.': function it_should_be_0_if_the_graph_is_empty() {
var graph = new Graph();
_assert["default"].strictEqual(graph.undirectedSize, 0);
},
'adding & dropping edges should affect undirected size.': function addingDroppingEdgesShouldAffectUndirectedSize() {
'adding & dropping edges should affect undirected size.': function adding__dropping_edges_should_affect_undirected_size() {
var graph = new Graph();

@@ -122,3 +127,3 @@ graph.addNode('John');

'#.multi': {
'it should be false by default.': function itShouldBeFalseByDefault() {
'it should be false by default.': function it_should_be_false_by_default() {
var graph = new Graph();

@@ -132,3 +137,3 @@ _assert["default"].strictEqual(graph.multi, false);

'#.type': {
'it should be "mixed" by default.': function itShouldBeMixedByDefault() {
'it should be "mixed" by default.': function it_should_be_Mixed_by_default() {
var graph = new Graph();

@@ -142,3 +147,3 @@ _assert["default"].strictEqual(graph.type, 'mixed');

'#.allowSelfLoops': {
'it should be true by default.': function itShouldBeTrueByDefault() {
'it should be true by default.': function it_should_be_true_by_default() {
var graph = new Graph();

@@ -152,3 +157,3 @@ _assert["default"].strictEqual(graph.allowSelfLoops, true);

'#.implementation': {
'it should exist and be a string.': function itShouldExistAndBeAString() {
'it should exist and be a string.': function it_should_exist_and_be_a_string() {
var graph = new Graph();

@@ -162,3 +167,3 @@ _assert["default"].strictEqual(_typeof(graph.implementation), 'string');

'#.selfLoopCount': {
'it should exist and be correct.': function itShouldExistAndBeCorrect() {
'it should exist and be correct.': function it_should_exist_and_be_correct() {
var graph = new Graph();

@@ -165,0 +170,0 @@ graph.mergeDirectedEdge('John', 'John');

@@ -9,3 +9,3 @@ "use strict";

var _helpers = require("./helpers");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
/**

@@ -24,3 +24,3 @@ * Graphology Read Specs

'#.hasNode': {
'it should correctly return whether the given node is found in the graph.': function itShouldCorrectlyReturnWhetherTheGivenNodeIsFoundInTheGraph() {
'it should correctly return whether the given node is found in the graph.': function it_should_correctly_return_whether_the_given_node_is_found_in_the_graph() {
var graph = new Graph();

@@ -33,3 +33,3 @@ _assert["default"].strictEqual(graph.hasNode('John'), false);

'#.hasDirectedEdge': {
'it should throw if invalid arguments are provided.': function itShouldThrowIfInvalidArgumentsAreProvided() {
'it should throw if invalid arguments are provided.': function it_should_throw_if_invalid_arguments_are_provided() {
var graph = new Graph();

@@ -40,3 +40,3 @@ _assert["default"]["throws"](function () {

},
'it should correctly return whether a matching edge exists in the graph.': function itShouldCorrectlyReturnWhetherAMatchingEdgeExistsInTheGraph() {
'it should correctly return whether a matching edge exists in the graph.': function it_should_correctly_return_whether_a_matching_edge_exists_in_the_graph() {
var graph = new Graph();

@@ -56,3 +56,3 @@ graph.addNode('Martha');

},
'it should work with self loops.': function itShouldWorkWithSelfLoops() {
'it should work with self loops.': function it_should_work_with_self_loops() {
var graph = new Graph();

@@ -65,3 +65,3 @@ graph.mergeDirectedEdge('Lucy', 'Lucy');

'#.hasUndirectedEdge': {
'it should throw if invalid arguments are provided.': function itShouldThrowIfInvalidArgumentsAreProvided() {
'it should throw if invalid arguments are provided.': function it_should_throw_if_invalid_arguments_are_provided() {
var graph = new Graph();

@@ -72,3 +72,3 @@ _assert["default"]["throws"](function () {

},
'it should correctly return whether a matching edge exists in the graph.': function itShouldCorrectlyReturnWhetherAMatchingEdgeExistsInTheGraph() {
'it should correctly return whether a matching edge exists in the graph.': function it_should_correctly_return_whether_a_matching_edge_exists_in_the_graph() {
var graph = new Graph();

@@ -88,3 +88,3 @@ graph.addNode('Martha');

},
'it should work with self loops.': function itShouldWorkWithSelfLoops() {
'it should work with self loops.': function it_should_work_with_self_loops() {
var graph = new Graph();

@@ -97,3 +97,3 @@ graph.mergeUndirectedEdge('Lucy', 'Lucy');

'#.hasEdge': {
'it should throw if invalid arguments are provided.': function itShouldThrowIfInvalidArgumentsAreProvided() {
'it should throw if invalid arguments are provided.': function it_should_throw_if_invalid_arguments_are_provided() {
var graph = new Graph();

@@ -104,3 +104,3 @@ _assert["default"]["throws"](function () {

},
'it should correctly return whether a matching edge exists in the graph.': function itShouldCorrectlyReturnWhetherAMatchingEdgeExistsInTheGraph() {
'it should correctly return whether a matching edge exists in the graph.': function it_should_correctly_return_whether_a_matching_edge_exists_in_the_graph() {
var graph = new Graph();

@@ -120,3 +120,3 @@ graph.addNode('Martha');

},
'it should work properly with typed graphs.': function itShouldWorkProperlyWithTypedGraphs() {
'it should work properly with typed graphs.': function it_should_work_properly_with_typed_graphs() {
var directedGraph = new Graph({

@@ -133,3 +133,3 @@ type: 'directed'

},
'it should work with self loops.': function itShouldWorkWithSelfLoops() {
'it should work with self loops.': function it_should_work_with_self_loops() {
var graph = new Graph();

@@ -141,3 +141,3 @@ graph.mergeUndirectedEdge('Lucy', 'Lucy');

},
'it should work with multi graphs (issue #431).': function itShouldWorkWithMultiGraphsIssue431() {
'it should work with multi graphs (issue #431).': function it_should_work_with_multi_graphs_Issue_431() {
var graph = new Graph({

@@ -156,3 +156,3 @@ multi: true,

'#.directedEdge': {
'it should throw if invalid arguments are provided.': function itShouldThrowIfInvalidArgumentsAreProvided() {
'it should throw if invalid arguments are provided.': function it_should_throw_if_invalid_arguments_are_provided() {
var graph = new Graph(),

@@ -173,3 +173,3 @@ multiGraph = new Graph({

},
'it should return the correct edge.': function itShouldReturnTheCorrectEdge() {
'it should return the correct edge.': function it_should_return_the_correct_edge() {
var graph = new Graph();

@@ -187,3 +187,3 @@ (0, _helpers.addNodesFrom)(graph, ['Jack', 'Lucy']);

},
'it should return the correct self loop.': function itShouldReturnTheCorrectSelfLoop() {
'it should return the correct self loop.': function it_should_return_the_correct_self_loop() {
var graph = new Graph();

@@ -197,3 +197,3 @@ graph.addNode('John');

'#.undirectedEdge': {
'it should throw if invalid arguments are provided.': function itShouldThrowIfInvalidArgumentsAreProvided() {
'it should throw if invalid arguments are provided.': function it_should_throw_if_invalid_arguments_are_provided() {
var graph = new Graph(),

@@ -214,3 +214,3 @@ multiGraph = new Graph({

},
'it should return the correct edge.': function itShouldReturnTheCorrectEdge() {
'it should return the correct edge.': function it_should_return_the_correct_edge() {
var graph = new Graph();

@@ -228,3 +228,3 @@ (0, _helpers.addNodesFrom)(graph, ['Jack', 'Lucy']);

},
'it should return the correct self loop.': function itShouldReturnTheCorrectSelfLoop() {
'it should return the correct self loop.': function it_should_return_the_correct_self_loop() {
var graph = new Graph();

@@ -238,3 +238,3 @@ graph.addNode('John');

'#.edge': {
'it should throw if invalid arguments are provided.': function itShouldThrowIfInvalidArgumentsAreProvided() {
'it should throw if invalid arguments are provided.': function it_should_throw_if_invalid_arguments_are_provided() {
var graph = new Graph(),

@@ -255,3 +255,3 @@ multiGraph = new Graph({

},
'it should return the correct edge.': function itShouldReturnTheCorrectEdge() {
'it should return the correct edge.': function it_should_return_the_correct_edge() {
var graph = new Graph();

@@ -264,3 +264,3 @@ (0, _helpers.addNodesFrom)(graph, ['Jack', 'Lucy']);

},
'it should return the correct self loop.': function itShouldReturnTheCorrectSelfLoop() {
'it should return the correct self loop.': function it_should_return_the_correct_self_loop() {
var graph = new Graph();

@@ -274,3 +274,3 @@ graph.addNode('John');

'#.areDirectedNeighbors': {
'it should throw if node is not in the graph.': function itShouldThrowIfNodeIsNotInTheGraph() {
'it should throw if node is not in the graph.': function it_should_throw_if_node_is_not_in_the_graph() {
var graph = new Graph();

@@ -281,3 +281,3 @@ _assert["default"]["throws"](function () {

},
'it should correctly return whether two nodes are neighbors.': function itShouldCorrectlyReturnWhetherTwoNodesAreNeighbors() {
'it should correctly return whether two nodes are neighbors.': function it_should_correctly_return_whether_two_nodes_are_neighbors() {
var graph = new Graph();

@@ -297,3 +297,3 @@ graph.mergeDirectedEdge('Mary', 'Joseph');

'#.areInNeighbors': {
'it should throw if node is not in the graph.': function itShouldThrowIfNodeIsNotInTheGraph() {
'it should throw if node is not in the graph.': function it_should_throw_if_node_is_not_in_the_graph() {
var graph = new Graph();

@@ -304,3 +304,3 @@ _assert["default"]["throws"](function () {

},
'it should correctly return whether two nodes are neighbors.': function itShouldCorrectlyReturnWhetherTwoNodesAreNeighbors() {
'it should correctly return whether two nodes are neighbors.': function it_should_correctly_return_whether_two_nodes_are_neighbors() {
var graph = new Graph();

@@ -320,3 +320,3 @@ graph.mergeDirectedEdge('Mary', 'Joseph');

'#.areOutNeighbors': {
'it should throw if node is not in the graph.': function itShouldThrowIfNodeIsNotInTheGraph() {
'it should throw if node is not in the graph.': function it_should_throw_if_node_is_not_in_the_graph() {
var graph = new Graph();

@@ -327,3 +327,3 @@ _assert["default"]["throws"](function () {

},
'it should correctly return whether two nodes are neighbors.': function itShouldCorrectlyReturnWhetherTwoNodesAreNeighbors() {
'it should correctly return whether two nodes are neighbors.': function it_should_correctly_return_whether_two_nodes_are_neighbors() {
var graph = new Graph();

@@ -343,3 +343,3 @@ graph.mergeDirectedEdge('Mary', 'Joseph');

'#.areOutboundNeighbors': {
'it should throw if node is not in the graph.': function itShouldThrowIfNodeIsNotInTheGraph() {
'it should throw if node is not in the graph.': function it_should_throw_if_node_is_not_in_the_graph() {
var graph = new Graph();

@@ -350,3 +350,3 @@ _assert["default"]["throws"](function () {

},
'it should correctly return whether two nodes are neighbors.': function itShouldCorrectlyReturnWhetherTwoNodesAreNeighbors() {
'it should correctly return whether two nodes are neighbors.': function it_should_correctly_return_whether_two_nodes_are_neighbors() {
var graph = new Graph();

@@ -366,3 +366,3 @@ graph.mergeDirectedEdge('Mary', 'Joseph');

'#.areInboundNeighbors': {
'it should throw if node is not in the graph.': function itShouldThrowIfNodeIsNotInTheGraph() {
'it should throw if node is not in the graph.': function it_should_throw_if_node_is_not_in_the_graph() {
var graph = new Graph();

@@ -373,3 +373,3 @@ _assert["default"]["throws"](function () {

},
'it should correctly return whether two nodes are neighbors.': function itShouldCorrectlyReturnWhetherTwoNodesAreNeighbors() {
'it should correctly return whether two nodes are neighbors.': function it_should_correctly_return_whether_two_nodes_are_neighbors() {
var graph = new Graph();

@@ -389,3 +389,3 @@ graph.mergeDirectedEdge('Mary', 'Joseph');

'#.areUndirectedNeighbors': {
'it should throw if node is not in the graph.': function itShouldThrowIfNodeIsNotInTheGraph() {
'it should throw if node is not in the graph.': function it_should_throw_if_node_is_not_in_the_graph() {
var graph = new Graph();

@@ -396,3 +396,3 @@ _assert["default"]["throws"](function () {

},
'it should correctly return whether two nodes are neighbors.': function itShouldCorrectlyReturnWhetherTwoNodesAreNeighbors() {
'it should correctly return whether two nodes are neighbors.': function it_should_correctly_return_whether_two_nodes_are_neighbors() {
var graph = new Graph();

@@ -412,3 +412,3 @@ graph.mergeDirectedEdge('Mary', 'Joseph');

'#.areNeighbors': {
'it should throw if node is not in the graph.': function itShouldThrowIfNodeIsNotInTheGraph() {
'it should throw if node is not in the graph.': function it_should_throw_if_node_is_not_in_the_graph() {
var graph = new Graph();

@@ -419,3 +419,3 @@ _assert["default"]["throws"](function () {

},
'it should correctly return whether two nodes are neighbors.': function itShouldCorrectlyReturnWhetherTwoNodesAreNeighbors() {
'it should correctly return whether two nodes are neighbors.': function it_should_correctly_return_whether_two_nodes_are_neighbors() {
var graph = new Graph();

@@ -436,3 +436,3 @@ graph.mergeDirectedEdge('Mary', 'Joseph');

'#.source': {
'it should throw if the edge is not in the graph.': function itShouldThrowIfTheEdgeIsNotInTheGraph() {
'it should throw if the edge is not in the graph.': function it_should_throw_if_the_edge_is_not_in_the_graph() {
var graph = new Graph();

@@ -443,3 +443,3 @@ _assert["default"]["throws"](function () {

},
'it should return the correct source.': function itShouldReturnTheCorrectSource() {
'it should return the correct source.': function it_should_return_the_correct_source() {
var graph = new Graph();

@@ -453,3 +453,3 @@ graph.addNode('John');

'#.target': {
'it should throw if the edge is not in the graph.': function itShouldThrowIfTheEdgeIsNotInTheGraph() {
'it should throw if the edge is not in the graph.': function it_should_throw_if_the_edge_is_not_in_the_graph() {
var graph = new Graph();

@@ -460,3 +460,3 @@ _assert["default"]["throws"](function () {

},
'it should return the correct target.': function itShouldReturnTheCorrectTarget() {
'it should return the correct target.': function it_should_return_the_correct_target() {
var graph = new Graph();

@@ -470,3 +470,3 @@ graph.addNode('John');

'#.extremities': {
'it should throw if the edge is not in the graph.': function itShouldThrowIfTheEdgeIsNotInTheGraph() {
'it should throw if the edge is not in the graph.': function it_should_throw_if_the_edge_is_not_in_the_graph() {
var graph = new Graph();

@@ -477,3 +477,3 @@ _assert["default"]["throws"](function () {

},
'it should return the correct extremities.': function itShouldReturnTheCorrectExtremities() {
'it should return the correct extremities.': function it_should_return_the_correct_extremities() {
var graph = new Graph();

@@ -487,3 +487,3 @@ graph.addNode('John');

'#.opposite': {
'it should throw if either the node or the edge is not found in the graph.': function itShouldThrowIfEitherTheNodeOrTheEdgeIsNotFoundInTheGraph() {
'it should throw if either the node or the edge is not found in the graph.': function it_should_throw_if_either_the_node_or_the_edge_is_not_found_in_the_graph() {
var graph = new Graph();

@@ -498,3 +498,3 @@ graph.addNode('Thomas');

},
'it should throw if the node & the edge are not related.': function itShouldThrowIfTheNodeTheEdgeAreNotRelated() {
'it should throw if the node & the edge are not related.': function it_should_throw_if_the_node__the_edge_are_not_related() {
var graph = new Graph();

@@ -507,3 +507,3 @@ (0, _helpers.addNodesFrom)(graph, ['Thomas', 'Isabella', 'Estelle']);

},
'it should return the correct node.': function itShouldReturnTheCorrectNode() {
'it should return the correct node.': function it_should_return_the_correct_node() {
var graph = new Graph();

@@ -516,3 +516,3 @@ (0, _helpers.addNodesFrom)(graph, ['Thomas', 'Estelle']);

'#.hasExtremity': {
'it should throw if either the edge is not found in the graph.': function itShouldThrowIfEitherTheEdgeIsNotFoundInTheGraph() {
'it should throw if either the edge is not found in the graph.': function it_should_throw_if_either_the_edge_is_not_found_in_the_graph() {
var graph = new Graph();

@@ -524,3 +524,3 @@ graph.mergeEdge('Thomas', 'Laura');

},
'it should return the correct answer.': function itShouldReturnTheCorrectAnswer() {
'it should return the correct answer.': function it_should_return_the_correct_answer() {
var graph = new Graph();

@@ -537,3 +537,3 @@ graph.addNode('Jack');

'#.isDirected': {
'it should throw if the edge is not in the graph.': function itShouldThrowIfTheEdgeIsNotInTheGraph() {
'it should throw if the edge is not in the graph.': function it_should_throw_if_the_edge_is_not_in_the_graph() {
var graph = new Graph();

@@ -544,3 +544,3 @@ _assert["default"]["throws"](function () {

},
'it should correctly return whether the edge is directed or not.': function itShouldCorrectlyReturnWhetherTheEdgeIsDirectedOrNot() {
'it should correctly return whether the edge is directed or not.': function it_should_correctly_return_whether_the_edge_is_directed_or_not() {
var graph = new Graph();

@@ -557,3 +557,3 @@ graph.addNode('John');

'#.isUndirected': {
'it should throw if the edge is not in the graph.': function itShouldThrowIfTheEdgeIsNotInTheGraph() {
'it should throw if the edge is not in the graph.': function it_should_throw_if_the_edge_is_not_in_the_graph() {
var graph = new Graph();

@@ -564,3 +564,3 @@ _assert["default"]["throws"](function () {

},
'it should correctly return whether the edge is undirected or not.': function itShouldCorrectlyReturnWhetherTheEdgeIsUndirectedOrNot() {
'it should correctly return whether the edge is undirected or not.': function it_should_correctly_return_whether_the_edge_is_undirected_or_not() {
var graph = new Graph();

@@ -577,3 +577,3 @@ graph.addNode('John');

'#.isSelfLoop': {
'it should throw if the edge is not in the graph.': function itShouldThrowIfTheEdgeIsNotInTheGraph() {
'it should throw if the edge is not in the graph.': function it_should_throw_if_the_edge_is_not_in_the_graph() {
var graph = new Graph();

@@ -584,3 +584,3 @@ _assert["default"]["throws"](function () {

},
'it should correctly return whether the edge is a self-loop or not.': function itShouldCorrectlyReturnWhetherTheEdgeIsASelfLoopOrNot() {
'it should correctly return whether the edge is a self-loop or not.': function it_should_correctly_return_whether_the_edge_is_a_selfLoop_or_not() {
var graph = new Graph();

@@ -597,3 +597,3 @@ graph.addNode('John');

'#.inDegree': {
'it should throw if the node is not found in the graph.': function itShouldThrowIfTheNodeIsNotFoundInTheGraph() {
'it should throw if the node is not found in the graph.': function it_should_throw_if_the_node_is_not_found_in_the_graph() {
var graph = new Graph();

@@ -604,3 +604,3 @@ _assert["default"]["throws"](function () {

},
'it should return the correct in degree.': function itShouldReturnTheCorrectInDegree() {
'it should return the correct in degree.': function it_should_return_the_correct_in_degree() {
var graph = new Graph();

@@ -615,3 +615,3 @@ (0, _helpers.addNodesFrom)(graph, ['Helen', 'Sue', 'William', 'John']);

},
'it should always return 0 in an undirected graph.': function itShouldAlwaysReturn0InAnUndirectedGraph() {
'it should always return 0 in an undirected graph.': function it_should_always_return_0_in_an_undirected_graph() {
var graph = new Graph({

@@ -626,3 +626,3 @@ type: 'undirected'

'#.inboundDegree': {
'it should throw if the node is not found in the graph.': function itShouldThrowIfTheNodeIsNotFoundInTheGraph() {
'it should throw if the node is not found in the graph.': function it_should_throw_if_the_node_is_not_found_in_the_graph() {
var graph = new Graph();

@@ -633,3 +633,3 @@ _assert["default"]["throws"](function () {

},
'it should return the correct in degree.': function itShouldReturnTheCorrectInDegree() {
'it should return the correct in degree.': function it_should_return_the_correct_in_degree() {
var graph = new Graph();

@@ -645,3 +645,3 @@ (0, _helpers.addNodesFrom)(graph, ['Helen', 'Sue', 'William', 'John']);

},
'it should always the undirected degree in an undirected graph.': function itShouldAlwaysTheUndirectedDegreeInAnUndirectedGraph() {
'it should always the undirected degree in an undirected graph.': function it_should_always_the_undirected_degree_in_an_undirected_graph() {
var graph = new Graph({

@@ -656,3 +656,3 @@ type: 'undirected'

'#.outDegree': {
'it should throw if the node is not found in the graph.': function itShouldThrowIfTheNodeIsNotFoundInTheGraph() {
'it should throw if the node is not found in the graph.': function it_should_throw_if_the_node_is_not_found_in_the_graph() {
var graph = new Graph();

@@ -663,3 +663,3 @@ _assert["default"]["throws"](function () {

},
'it should return the correct out degree.': function itShouldReturnTheCorrectOutDegree() {
'it should return the correct out degree.': function it_should_return_the_correct_out_degree() {
var graph = new Graph();

@@ -674,3 +674,3 @@ (0, _helpers.addNodesFrom)(graph, ['Helen', 'Sue', 'William', 'John']);

},
'it should always return 0 in an undirected graph.': function itShouldAlwaysReturn0InAnUndirectedGraph() {
'it should always return 0 in an undirected graph.': function it_should_always_return_0_in_an_undirected_graph() {
var graph = new Graph({

@@ -685,3 +685,3 @@ type: 'undirected'

'#.outboundDegree': {
'it should throw if the node is not found in the graph.': function itShouldThrowIfTheNodeIsNotFoundInTheGraph() {
'it should throw if the node is not found in the graph.': function it_should_throw_if_the_node_is_not_found_in_the_graph() {
var graph = new Graph();

@@ -692,3 +692,3 @@ _assert["default"]["throws"](function () {

},
'it should return the correct out degree.': function itShouldReturnTheCorrectOutDegree() {
'it should return the correct out degree.': function it_should_return_the_correct_out_degree() {
var graph = new Graph();

@@ -704,3 +704,3 @@ (0, _helpers.addNodesFrom)(graph, ['Helen', 'Sue', 'William', 'John']);

},
'it should always the undirected degree in an undirected graph.': function itShouldAlwaysTheUndirectedDegreeInAnUndirectedGraph() {
'it should always the undirected degree in an undirected graph.': function it_should_always_the_undirected_degree_in_an_undirected_graph() {
var graph = new Graph({

@@ -715,3 +715,3 @@ type: 'undirected'

'#.directedDegree': {
'it should throw if the node is not found in the graph.': function itShouldThrowIfTheNodeIsNotFoundInTheGraph() {
'it should throw if the node is not found in the graph.': function it_should_throw_if_the_node_is_not_found_in_the_graph() {
var graph = new Graph();

@@ -722,3 +722,3 @@ _assert["default"]["throws"](function () {

},
'it should return the correct directed degree.': function itShouldReturnTheCorrectDirectedDegree() {
'it should return the correct directed degree.': function it_should_return_the_correct_directed_degree() {
var graph = new Graph();

@@ -736,3 +736,3 @@ (0, _helpers.addNodesFrom)(graph, ['Helen', 'Sue', 'William', 'John', 'Martha']);

},
'it should always return 0 in an undirected graph.': function itShouldAlwaysReturn0InAnUndirectedGraph() {
'it should always return 0 in an undirected graph.': function it_should_always_return_0_in_an_undirected_graph() {
var graph = new Graph({

@@ -747,3 +747,3 @@ type: 'undirected'

'#.undirectedDegree': {
'it should throw if the node is not found in the graph.': function itShouldThrowIfTheNodeIsNotFoundInTheGraph() {
'it should throw if the node is not found in the graph.': function it_should_throw_if_the_node_is_not_found_in_the_graph() {
var graph = new Graph();

@@ -754,3 +754,3 @@ _assert["default"]["throws"](function () {

},
'it should return the correct undirected degree.': function itShouldReturnTheCorrectUndirectedDegree() {
'it should return the correct undirected degree.': function it_should_return_the_correct_undirected_degree() {
var graph = new Graph();

@@ -766,3 +766,3 @@ (0, _helpers.addNodesFrom)(graph, ['Helen', 'Sue', 'William', 'John']);

},
'it should always return 0 in a directed graph.': function itShouldAlwaysReturn0InADirectedGraph() {
'it should always return 0 in a directed graph.': function it_should_always_return_0_in_a_directed_graph() {
var graph = new Graph({

@@ -777,3 +777,3 @@ type: 'directed'

'#.degree': {
'it should throw if the node is not found in the graph.': function itShouldThrowIfTheNodeIsNotFoundInTheGraph() {
'it should throw if the node is not found in the graph.': function it_should_throw_if_the_node_is_not_found_in_the_graph() {
var graph = new Graph();

@@ -784,3 +784,3 @@ _assert["default"]["throws"](function () {

},
'it should return the correct degree.': function itShouldReturnTheCorrectDegree() {
'it should return the correct degree.': function it_should_return_the_correct_degree() {
var graph = new Graph();

@@ -799,3 +799,3 @@ (0, _helpers.addNodesFrom)(graph, ['Helen', 'Sue', 'William', 'John', 'Martha']);

},
'it should also work with typed graphs.': function itShouldAlsoWorkWithTypedGraphs() {
'it should also work with typed graphs.': function it_should_also_work_with_typed_graphs() {
var directedGraph = new Graph({

@@ -816,3 +816,3 @@ type: 'directed'

},
'it should correctly consider self loops in the multi case (issue #431).': function itShouldCorrectlyConsiderSelfLoopsInTheMultiCaseIssue431() {
'it should correctly consider self loops in the multi case (issue #431).': function it_should_correctly_consider_self_loops_in_the_multi_case_Issue_431() {
var multiGraph = new Graph({

@@ -819,0 +819,0 @@ multi: true

@@ -9,3 +9,3 @@ "use strict";

var _helpers = require("./helpers");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
/**

@@ -23,3 +23,3 @@ * Graphology Serializaton Specs

'#.export': {
'it should correctly return the serialized graph.': function itShouldCorrectlyReturnTheSerializedGraph() {
'it should correctly return the serialized graph.': function it_should_correctly_return_the_serialized_graph() {
var graph = new Graph({

@@ -90,3 +90,3 @@ multi: true

},
'it should not need to tell whether edges are undirected if the graph is.': function itShouldNotNeedToTellWhetherEdgesAreUndirectedIfTheGraphIs() {
'it should not need to tell whether edges are undirected if the graph is.': function it_should_not_need_to_tell_whether_edges_are_undirected_if_the_graph_is() {
var graph = new Graph({

@@ -117,3 +117,3 @@ type: 'undirected'

'#.import': {
'it should throw if the given data is invalid.': function itShouldThrowIfTheGivenDataIsInvalid() {
'it should throw if the given data is invalid.': function it_should_throw_if_the_given_data_is_invalid() {
var graph = new Graph();

@@ -124,3 +124,3 @@ _assert["default"]["throws"](function () {

},
'it should be possible to import a graph instance.': function itShouldBePossibleToImportAGraphInstance() {
'it should be possible to import a graph instance.': function it_should_be_possible_to_import_a_graph_instance() {
var graph = new Graph();

@@ -134,3 +134,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Thomas']);

},
'it should be possible to import a serialized graph.': function itShouldBePossibleToImportASerializedGraph() {
'it should be possible to import a serialized graph.': function it_should_be_possible_to_import_a_serialized_graph() {
var graph = new Graph();

@@ -151,3 +151,3 @@ graph["import"]({

},
'it should be possible to import only edges when merging.': function itShouldBePossibleToImportOnlyEdgesWhenMerging() {
'it should be possible to import only edges when merging.': function it_should_be_possible_to_import_only_edges_when_merging() {
var graph = new Graph();

@@ -164,3 +164,3 @@ graph["import"]({

},
'it should be possible to import attributes.': function itShouldBePossibleToImportAttributes() {
'it should be possible to import attributes.': function it_should_be_possible_to_import_attributes() {
var graph = new Graph();

@@ -176,3 +176,3 @@ graph["import"]({

},
'it should throw if nodes are absent, edges are present and we merge.': function itShouldThrowIfNodesAreAbsentEdgesArePresentAndWeMerge() {
'it should throw if nodes are absent, edges are present and we merge.': function it_should_throw_if_nodes_are_absent_edges_are_present_and_we_merge() {
var graph = new Graph();

@@ -188,3 +188,3 @@ _assert["default"]["throws"](function () {

},
'it should import undirected graphs properly.': function itShouldImportUndirectedGraphsProperly() {
'it should import undirected graphs properly.': function it_should_import_undirected_graphs_properly() {
var graph = Graph.from({

@@ -191,0 +191,0 @@ options: {

@@ -9,3 +9,3 @@ "use strict";

var _helpers = require("./helpers");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
/**

@@ -23,3 +23,3 @@ * Graphology Utils Specs

'#.nullCopy': {
'it should create an null copy of the graph.': function itShouldCreateAnNullCopyOfTheGraph() {
'it should create an null copy of the graph.': function it_should_create_an_null_copy_of_the_graph() {
var graph = new Graph();

@@ -36,3 +36,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Thomas']);

},
'it should be possible to pass options to merge.': function itShouldBePossibleToPassOptionsToMerge() {
'it should be possible to pass options to merge.': function it_should_be_possible_to_pass_options_to_merge() {
var graph = new Graph({

@@ -49,3 +49,3 @@ type: 'directed'

},
'copying the graph should conserve its attributes.': function copyingTheGraphShouldConserveItsAttributes() {
'copying the graph should conserve its attributes.': function copying_the_graph_should_conserve_its_attributes() {
var graph = new Graph();

@@ -58,3 +58,3 @@ graph.setAttribute('title', 'The Graph');

'#.emptyCopy': {
'it should create an empty copy of the graph.': function itShouldCreateAnEmptyCopyOfTheGraph() {
'it should create an empty copy of the graph.': function it_should_create_an_empty_copy_of_the_graph() {
var graph = new Graph();

@@ -79,3 +79,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Thomas']);

},
'it should be possible to pass options to merge.': function itShouldBePossibleToPassOptionsToMerge() {
'it should be possible to pass options to merge.': function it_should_be_possible_to_pass_options_to_merge() {
var graph = new Graph({

@@ -92,3 +92,3 @@ type: 'directed'

},
'copying the graph should conserve its attributes.': function copyingTheGraphShouldConserveItsAttributes() {
'copying the graph should conserve its attributes.': function copying_the_graph_should_conserve_its_attributes() {
var graph = new Graph();

@@ -101,3 +101,3 @@ graph.setAttribute('title', 'The Graph');

'#.copy': {
'it should create a full copy of the graph.': function itShouldCreateAFullCopyOfTheGraph() {
'it should create a full copy of the graph.': function it_should_create_a_full_copy_of_the_graph() {
var graph = new Graph();

@@ -115,3 +115,3 @@ (0, _helpers.addNodesFrom)(graph, ['John', 'Thomas']);

},
'it should not break when copying a graph with wrangled edge ids (issue #213).': function itShouldNotBreakWhenCopyingAGraphWithWrangledEdgeIdsIssue213() {
'it should not break when copying a graph with wrangled edge ids (issue #213).': function it_should_not_break_when_copying_a_graph_with_wrangled_edge_ids_Issue_213() {
var graph = new Graph();

@@ -145,3 +145,3 @@ graph.addNode('n0');

},
'it should not break on adversarial inputs.': function itShouldNotBreakOnAdversarialInputs() {
'it should not break on adversarial inputs.': function it_should_not_break_on_adversarial_inputs() {
var graph = new Graph();

@@ -159,3 +159,3 @@ graph.mergeEdge(0, 1);

},
'copying the graph should conserve its attributes.': function copyingTheGraphShouldConserveItsAttributes() {
'copying the graph should conserve its attributes.': function copying_the_graph_should_conserve_its_attributes() {
var graph = new Graph();

@@ -166,3 +166,3 @@ graph.setAttribute('title', 'The Graph');

},
'it should be possible to upgrade a graph.': function itShouldBePossibleToUpgradeAGraph() {
'it should be possible to upgrade a graph.': function it_should_be_possible_to_upgrade_a_graph() {
var strict = new Graph({

@@ -169,0 +169,0 @@ type: 'directed',

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet