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

tessellatron

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tessellatron - npm Package Compare versions

Comparing version 0.4.3 to 0.4.4

src/graph/hypercube.test.js

9

package.json
{
"name": "tessellatron",
"version": "0.4.3",
"version": "0.4.4",
"description": "Tessellatron creates graphs (represented by json structures) with tesselating spacial patterns.",

@@ -26,7 +26,10 @@ "keywords": [

"dependencies": {},
"devDependencies": {},
"devDependencies": {
"chai": "^4.2.0",
"mocha": "^8.2.1"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"test": "mocha './src/**/*.test.js' --recursive",
"start": "node ./src/main.js"
}
}

@@ -94,3 +94,8 @@ import Cell from '../cell.js'

// the app gets both from magnitudes.
// this special `ordinals` array relates to antipodes.
// its important just in case some of the dimensions are valued at 1.
this.ordinals = []
// the app gets all three from magnitudes.
for (let dg = 0; dg < this.degree; dg++) {

@@ -116,2 +121,3 @@

this.antipodes[positive] = negative
this.ordinals.push(new Set([positive, negative]))
}

@@ -259,17 +265,31 @@

// set up loop over the keys and values of rose.
const entries = Object.entries(this.compass)
for (const [direction, modifier] of entries) {
// track all modifiers used in the loop.
let usedModifiers = new Set()
// calculate potential neighbor via modifier.
const id02 = id01 + modifier
// set up loop over the directions via opposite-ordinals.
// bigger-magnitude directions come first.
for (const directions of [...this.ordinals].reverse()) {
for (const direction of directions) {
const modifier = this.compass[direction]
// ensure both IDs are valid, and add to neighbors.
if (this.holdsNeighbors(id01, id02)) {
neighbors[direction] = id02
// calculate potential neighbor via modifier.
const id02 = id01 + modifier
// if they are not, then the neighbor is void.
// id01 must be a corner- or edge-piece.
} else {
neighbors[direction] = null
// skip any "stale" modifiers.
// it happens with dimensions of length one!
if (usedModifiers.has(modifier)) {
neighbors[direction] = null
}
// ensure both IDs are valid, and add to neighbors.
else if (this.holdsNeighbors(id01, id02)) {
neighbors[direction] = id02
usedModifiers.add(modifier)
}
// if they are not, then the neighbor is void.
// id01 must be a corner- or edge-piece.
else {
neighbors[direction] = null
}
}

@@ -276,0 +296,0 @@ }

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