
Product
Socket Now Protects the Chrome Extension Ecosystem
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Given two points and a range of regions, determines which region the second point is in with relation to the first
This library lets you split up a circle into regions and figure out what region a point is in with relation to a center point.
Here's an example:
import { determineRegion, getRegions } from 'regional'
// This breaks our 'circle' into four regions, like this:
// │ 0/360 degrees
// ┌─────┼─────┐
// │ 0 │ 3 │
// ├─────○─────│
// │ 1 │ 2 │
// └─────┴─────┘
const regions = getRegions(4);
const region = determineRegion(
[0, 0],
[-2, -2], // a point that is 45 degrees clockwise from the start
regions
);
const i = regions.findIndex(r => r === region);
// i === 0
One thing to be careful of is where the starting angle is — the 0 degree mark is at the top vertical, not the right horizontal like is often seen. Also, x values increase from left to right, while y values increase from top to bottom
determineRegions(p1: [number, number], p2: [number, number], regions: Array<region>): region
Returns the region object from the regions array that contains p2getRegions(numberOfSides: number): Array<region>
Returns an array of regions that is essentially a circle split into as many regions as the number providedFAQs
Given two points and a range of regions, determines which region the second point is in with relation to the first
The npm package regional receives a total of 2 weekly downloads. As such, regional popularity was classified as not popular.
We found that regional 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 is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.