
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
graphology-assertions
Advanced tools
Assertions to be used with graphology
.
npm install graphology-assertions
Function returning whether the given value is a graphology
implementation's instance.
import {isGraph} from 'graphology-assertions';
const graph = new Graph();
isGraph(graph);
>>> true
isGraph(45);
>>> false
isGraph({hello: 'world'});
>>> false
Arguments
Function returning whether the given value is a graphology
constructor.
import {isGraphConstructor} from 'graphology-assertions';
isGraphConstructor(Graph);
>>> true
isGraphConstructor(45);
>>> false
isGraphConstructor(new Graph());
>>> false
Arguments
Returns whether two graphs have the same nodes.
import {haveSameNodes} from 'graphology-assertions';
haveSameNodes(G, H);
Returns whether two graphs have the same nodes & whether those nodes have the same attributes.
import {haveSameNodesDeep} from 'graphology-assertions';
haveSameNodesDeep(G, H);
Returns whether two graphs are the same.
import {areSameGraphs} from 'graphology-assertions';
areSameGraphs(G, H);
Returns whether two graphs as well as their node & edge attributes are the same.
import {areSameGraphsDeep} from 'graphology-assertions';
areSameGraphsDeep(G, H);
Returns whether two graphs have the same edges. Note that it implies that both graphs' nodes are also the same.
This is different than areSameGraphs because it will allow different graph types to be compared, e.g. a mixed graph and a directed one having the same edges nonetheless.
import {haveSameEdges} from 'graphology-assertions';
haveSameEdges(G, H);
Returns whether two graphs have the same edges & whether those edges have the same attributes. Note that it implies that both graphs' nodes are also the same.
This is different than areSameGraphsDeep because it will allow different graph types to be compared, e.g. a mixed graph and a directed one having the same edges nonetheless.
import {haveSameEdgesDeep} from 'graphology-assertions';
haveSameEdgesDeep(G, H);
FAQs
Assertions for graphology.
The npm package graphology-assertions receives a total of 1,181 weekly downloads. As such, graphology-assertions popularity was classified as popular.
We found that graphology-assertions demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.