
Product
Announcing Socket Certified Patches: One-Click Fixes for Vulnerable Dependencies
A safer, faster way to eliminate vulnerabilities without updating dependencies
@darkaqua/flood-fill
Advanced tools
A simple 2D [flood fill](http://en.wikipedia.org/wiki/Flood_fill) with no stupid dependencies!
A simple 2D flood fill with no stupid dependencies!
You could use this to re-implement Microsoft Paint's bucket fill in JavaScript, or in procedural dungeon generation to identify disconnected rooms.
import { getGrid } from './mod.ts';
const grid = createGrid(50, 50);
for (let x = 0; x < 50; x++) {
grid.set(x, 10, 1);
grid.set(x, 21, 1);
}
for (let y = 0; y < 50; y++) {
grid.set(10, y, 1);
grid.set(22, y, 1);
}
const result = grid.floodFill(30, 19);
let output = "";
for (let y = 0; y < grid.height; y++) {
for (let x = 0; x < grid.width; x++) {
const cell = grid.cells[y * grid.width + x];
const filledCell = result.filledGrid.cells[y * grid.width + x];
output += cell !== 0 ? "#" : filledCell !== 0 ? "@" : " ";
}
if (y < grid.height - 1) {
output += "\n";
}
}
console.log(output);
FAQs
A simple 2D [flood fill](http://en.wikipedia.org/wiki/Flood_fill) with no stupid dependencies!
We found that @darkaqua/flood-fill demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
A safer, faster way to eliminate vulnerabilities without updating dependencies

Product
Reachability analysis for Ruby is now in beta, helping teams identify which vulnerabilities are truly exploitable in their applications.

Research
/Security News
Malicious npm packages use Adspect cloaking and fake CAPTCHAs to fingerprint visitors and redirect victims to crypto-themed scam sites.