
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
#Bearded 2 Dimensional Arrays
If you can understand how to deal with it, it becomes just another data type
Installing:
$ yarn add bearded-2d
And then somewhere in your code:
import Grid from 'bearded-2d'
const grid = new Grid([
[1,2,3],
[4,5,6],
[7,8,9]
])
##API
Method | Arguments | Returns |
---|---|---|
rows | null | two-dimensional array |
columns | null | two-dimensional array |
value | null | two-dimensional array |
map | fn: Function | new Grid |
contains | val: any | Boolean |
locations | null | two-dimensional array |
get | location: double/number | Array/any |
set | location: double/number, value: any | undefined |
block | start: double, width: number, height: number | two-dimensional array |
##Note on Set
Set will make grid.__value into a square regardless of the index given. For instance, if your grid is 3 by 3 and you grid.set([5,5],val)
, you will now have a 5 by 5 grid with [undefined,undefined,undefined,undefined, undefined, undefined]
and your rows will be [1,2,3,undefined,undefined,undefined]
, i.e. It will create undefined rows and columns if you give it a bigger index than it can handle
FAQs
A basic abstraction atop a 2 dimensional array
We found that bearded-2d demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.