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

@sbj42/maze-generator-core

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sbj42/maze-generator-core - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

2

package.json
{
"name": "@sbj42/maze-generator-core",
"version": "0.1.3",
"version": "0.1.4",
"description": "Core library for maze generator algorithms",

@@ -5,0 +5,0 @@ "main": "src",

@@ -28,2 +28,6 @@ /**

this._blockWidth = (width+31) >> 5;
if (options._grid) {
this._grid = options._grid;
return;
}
this._grid = new Array(this._blockWidth * height);

@@ -55,2 +59,14 @@ var initBlock = interior ? ~0 : 0;

/**
* Returns a copy of the GridMask.
*
* @return {GridMask}
*/
GridMask.prototype.clone = function() {
return new GridMask(this.width(), this.height(), {
exterior: this._exterior,
_grid: this._grid.slice()
});
};
/**
* Returns the boolean value at the specified cell

@@ -93,2 +109,28 @@ *

/**
* ...
*
* @param {integer} x
* @param {integer} y
* @param {boolean} [value=true]
*/
GridMask.prototype.testAndSet = function(x, y, value) {
if (value == null)
value = true;
if (x < 0 || x >= this._width || y < 0 || y >= this._height) {
if (this._exterior == value)
return false;
throw new Error('cell out of bounds: ' + x + ',' + y);
}
var index = y * this._blockWidth + (x >> 5);
var mask = 1 << (x & 31);
if (((this._grid[index] & mask) != 0) == value)
return false;
if (value)
this._grid[index] |= mask;
else
this._grid[index] &= ~mask;
return true;
};
module.exports = GridMask;
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