Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

@tangle/graph

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tangle/graph - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

5

index.js

@@ -65,5 +65,4 @@ const { LinkMap, BacklinkMap } = require('./maps')

get rootNodeKeys () {
return this.rootKeys
}
get rootNodeKeys () { return this.rootKeys }
get rootNodes () { return this.rootKeys.map(k => this.getNode(k)) }

@@ -70,0 +69,0 @@ get raw () {

2

package.json
{
"name": "@tangle/graph",
"version": "1.1.0",
"version": "1.2.0",
"description": "a helper for building + updating traverseable tangle graphs",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -107,7 +107,14 @@ # @tangle/graph

### `graph.rootNodeKeys`
### `graph.rootNodes => [Node]`
A getter which gives you access to an Array of root nodes
(i.e. are the starting points of the graph)
### `graph.rootNodeKeys => [Key]`
A getter which gives you access to an Array of keys for nodes which are "roots"
within the graph (i.e. are the starting points of the graph)
(alias: `graph.rootKeys`)
### `graph.raw`

@@ -114,0 +121,0 @@

@@ -45,4 +45,5 @@ const test = require('tape')

test('Graph.rootKeys', t => {
test('graph.rootKeys', t => {
t.deepEqual(graph.rootKeys, ['A'], 'rootKeys')
t.deepEqual(graph.rootNodeKeys, ['A'], 'alias: rootNodeKeys')

@@ -52,3 +53,9 @@ t.end()

test('Graph.getNode', t => {
test('graph.rootNodes', t => {
t.deepEqual(graph.rootNodes, [A], 'rootNodes')
t.end()
})
test('graph.getNode', t => {
t.equal(graph.getNode('A'), A, 'getNode')

@@ -62,3 +69,3 @@ t.equal(graph.getNode('W'), null, 'disconnected node not returned')

test('Graph.getLinks', t => {
test('graph.getLinks', t => {
t.deepEqual(graph.getLinks('A'), ['B', 'C'], 'getLinks')

@@ -72,3 +79,3 @@ t.deepEqual(graph.getLinks('W'), [], 'no links for disconnected')

test('Graph.getBacklinks', t => {
test('graph.getBacklinks', t => {
/* getBacklinks */

@@ -83,3 +90,3 @@ t.deepEqual(graph.getBacklinks('B'), ['A'], 'getBacklinks')

test('Graph.isBranchNode', t => {
test('graph.isBranchNode', t => {
/* isBranchNode */

@@ -96,3 +103,3 @@ t.equal(graph.isBranchNode('A'), true, 'A is a branchNode')

test('Graph.isMergeNode', t => {
test('graph.isMergeNode', t => {
t.equal(graph.isMergeNode('A'), false, 'A not merge node')

@@ -108,3 +115,3 @@ t.equal(graph.isMergeNode('B'), false, 'B not merge node')

test('Graph.isHeadNode', t => {
test('graph.isHeadNode', t => {
t.equal(graph.isHeadNode('A'), false, 'A not headNode')

@@ -120,3 +127,3 @@ t.equal(graph.isHeadNode('B'), false, 'B not headNode')

test('Graph.invalidateKeys', t => {
test('graph.invalidateKeys', t => {
graph.invalidateKeys(['B'])

@@ -123,0 +130,0 @@ // A (root)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc