Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Find bounding box dimensions either within or surrounding arbitrary containers
Available as a node package. To install use
$ npm install bbox
The following methods are available
BBox.create(x0, y0, x1, y1)
OR
BBox.create(width, height)
Creates a frozen bbox object with both position and dimensions. When using dimensions the box has undefined location but can still be used for its aspect ratio.
var BBox = require('bbox');
var fixed = BBox.create(1, 1, 4, 4);
// => {x0: 1, y0: 1, x1: 4, y1: 4, width: 3, height: 3}
var floating = BBox.create(2, 3);
// => {width: 2, height: 3, x0: undefined, y0: undefined, x1: undefined, y1: undefined}
BBox.fit(container, aspect)
Creates the largest box with the same aspect ratio as aspect
that will fit within container
. The box is centered within container
. Note container requires a fixed bbox but aspect may be fixed or floating.
var container = BBox.create(0, 0, 100, 100);
var aspect = BBox.create(250, 500);
BBox.fit(container, aspect);
// => {x0: 25, y0: 0, x1: 75, y1: 100, width: 50, height: 100}
BBox.surround(container, aspect)
Creates the smallest box with the same aspect ratio as aspect
that will surround container
. The box is centered around container
. Note container requires a fixed bbox but aspect may be fixed or floating.
var container = BBox.create(0, 0, 100, 100);
var aspect = BBox.create(250, 500);
BBox.surround(container, aspect);
// => {x0: 0, y0: -50, x1: 100, y1: 150, width: 100, height: 200}
FAQs
Find bounding box dimensions either within or surrounding arbitrary containers
The npm package bbox receives a total of 61 weekly downloads. As such, bbox popularity was classified as not popular.
We found that bbox 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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.