
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
interval-operations
Advanced tools
Utilities for performing mathematical set operations on intervals and arrays of intervals
A collection of dependency-free utility functions for performing mathematical set operations on intervals and arrays of intervals.
npm install interval-operations
// or, with yarn
yarn add interval-operations
import { union, arrayUnion } from 'interval-operations';
union([1,3], [2,4], [5,7]); // [[1,4], [5,7]]
arrayUnion([[1,3], [5,7]], [[2,4], [6,8]]); // [[1,4], [5,8]]
import { intersection, arrayIntersection } from 'interval-operations';
intersection([1,3], [2,4]); // [2,3]
intersection([1,2], [3,4]); // null
arrayIntersection([[1,3], [5,7]], [[2,4], [6,8]]); // [[2,3], [5,6]]
import { difference, arrayDifference } from 'interval-operations';
difference([1,3], [2,3]); // [1,2]
arrayDifference([[1,3], [4,6]], [[2,5]]); // [[1,2], [5,6]]
import { contains, arrayContains } from 'interval-operations';
contains([1,3], [2,3]); // true
contains([1,3], [3,4]); // false
arrayContains([[1,3], [2,5]], [[1,5]]); // true
const store1Hours = [
[new Date('2019-03-14 08:00'), new Date('2019-03-14 16:00')],
[new Date('2019-03-16 10:00'), new Date('2019-03-16 14:00')]
];
const store2Hours = [
[new Date('2019-03-14 10:00'), new Date('2019-03-14 14:00')],
[new Date('2019-03-15 08:00'), new Date('2019-03-15 16:00')],
];
// When is at least one store open?
arrayUnion(store1Hours, store2Hours);
/* [
[new Date('2019-03-14 08:00'), new Date('2019-03-14 16:00')],
[new Date('2019-03-15 08:00'), new Date('2019-03-15 16:00')],
[new Date('2019-03-16 10:00'), new Date('2019-03-16 14:00')]
] */
// When are both stores open?
arrayIntersection(store1Hours, store2Hours);
// [[new Date('2019-03-14 10:00'), new Date('2019-03-14 14:00')]]
// When is only store 1 open?
arrayDifference(store1Hours, store2Hours);
/* [
[new Date('2019-03-14 08:00'), new Date('2019-03-14 10:00')],
[new Date('2019-03-14 14:00'), new Date('2019-03-14 16:00')],
[new Date('2019-03-16 10:00'), new Date('2019-03-16 14:00')]
] */
FAQs
Utilities for performing mathematical set operations on intervals and arrays of intervals
The npm package interval-operations receives a total of 7,327 weekly downloads. As such, interval-operations popularity was classified as popular.
We found that interval-operations 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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.