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

@tangle/graph

Package Overview
Dependencies
Maintainers
3
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 3.0.2 to 3.1.0

7

index.js

@@ -30,2 +30,6 @@ const { LinkMap, BacklinkMap } = require('./maps')

this.tipKeys = this.nodes
.filter(node => this.isTipNode(node.key))
.map(node => node.key)
// if (containsCycles(this.lookup.connected, this._getBacklinks)) throw new Error('there is a cycle in connected nodes')

@@ -89,2 +93,5 @@ }

get tipNodeKeys () { return this.tipKeys }
get tipNodes () { return this.tipKeys.map(k => this.getNode(k)) }
get raw () {

@@ -91,0 +98,0 @@ return {

8

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

@@ -31,7 +31,7 @@ "main": "index.js",

"devDependencies": {
"@tangle/test": "^1.2.0",
"standard": "^16.0.3",
"@tangle/test": "^2.1.1",
"standard": "^17.0.0",
"tap-arc": "^0.3.5",
"tape": "^5.0.1"
"tape": "^5.6.3"
}
}

@@ -88,3 +88,2 @@ # @tangle/graph

### `graph.getPrevious(key) => [key]`

@@ -126,3 +125,3 @@

### `graph.rootNodeKeys => [Key]`
### `graph.rootKeys => [Key]`

@@ -132,4 +131,16 @@ A getter which gives you access to an Array of keys for nodes which are "roots"

(alias: `graph.rootKeys`)
(alias: `graph.rootNodeKeys`)
### `graph.tipNodes => [Node]`
A getter which gives you access to an Array of tip nodes
(i.e. are the ending points of the graph)
### `graph.tipKeys => [Key]`
A getter which gives you access to an Array of keys for nodes which are "tips"
within the graph (i.e. are the ending points of the graph)
(alias: `graph.tipNodeKeys`)
### `graph.raw`

@@ -136,0 +147,0 @@

@@ -62,2 +62,15 @@ const test = require('tape')

test('graph.tipKeys', t => {
t.deepEqual(graph.tipKeys, ['D'], 'tipKeys')
t.deepEqual(graph.tipNodeKeys, ['D'], 'alias: tipNodeKeys')
t.end()
})
test('graph.tipNodes', t => {
t.deepEqual(graph.tipNodes, [D], 'tipNodes')
t.end()
})
test('graph.getNode', t => {

@@ -64,0 +77,0 @@ t.equal(graph.getNode('A'), A, 'getNode')

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