Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
ranges-set
Advanced tools
Set operations on human-friendly ranges.
A naive implementation of this package would always expand the sets first and then operate on arrays or native Set
objects. While this approach works, one can hang your app with a simple input of 1-1000000000
.
That is why ranges-set
operates on actual ranges, resulting in performance scalable with the number of ranges (i.e., the number of commas). Caution: it is not the case for expand
, as it has to return all elements!
import { difference, expand, intersection, normalize, subset, union } from 'ranges-set';
difference('1-4', '2-3'); // '1,4'
expand('1-3,5-7'); // ['1', '2', '3', '5', '6', '7']
intersection('1-10', '5-10'); // '5-10'
normalize('1,2,3,5,6-8'); // '1-3,5-8'
subset('1-3', '1-2'); // true
union('1-60,40-100'); // '1-100'
function difference(textA: string, textB: string): string;
function expand(text: string): string[];
function intersection(textA: string, textB: string): string;
function normalize(text: string): string;
function subset(textA: string, textB: string): boolean;
function union(textA: string, textB: string): string;
FAQs
Set operations on human-friendly ranges.
The npm package ranges-set receives a total of 132 weekly downloads. As such, ranges-set popularity was classified as not popular.
We found that ranges-set demonstrated a healthy version release cadence and project activity because the last version was released less than 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.