![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
interval-spans
Advanced tools
[![npm](https://img.shields.io/npm/v/interval-spans?style=plastic)](https://www.npmjs.com/package/interval-spans)
For when you need to create interval spans and no other library will do.
Easily create interval spans, look up to which interval span a number belongs to (if any) and attach metadata to your interval spans.
yarn add interval-spans
npm install interval-spans
Creates an interval span from start
(inclusive) to end
(exclusive) and attach
new IntervalSpan<MetadataShape = Record<string, any>>(start: number, end: number, metadata?: MetadataShape);
import { IntervalSpan } from 'interval-span';
const singleDigitIntegerSpan = new IntervalSpan<{ name: string }>(0, 10, {
name: 'single-digits',
});
instance.includes(numberToTest: number): boolean;
const intervalSpan = new IntervalSpan(0, 10);
intervalSpan.includes(0); // true
intervalSpan.includes(10); // false
new IntervalSpans(intervalSpans: IntervalSpan[]);
import { IntervalSpans } from 'interval-spans';
const intervalSpans = new IntervalSpans([new IntervalSpan(0, 10), new IntervalSpan(10, 20)]);
Finds the span which includes a number.
instance.getSpanByNumber(numberToTest: number): IntervalSpan | null;
const intervalSpans = new IntervalSpans<{ name: string }>([
new IntervalSpan(0, 10, { name: 'single-digits' }),
new IntervalSpan(10, 20, { name: 'ten-to-twenty' }),
]);
intervalSpans.getSpanByNumber(0); // { start: 0, end: 10, metadata: { name: 'single-digits' }}
intervalSpans.getSpanByNumber(10); // { start: 10, end: 20, metadata: { name: 'ten-to-twenty' }}
intervalSpans.getSpanByNumber(20); // undefined;
MIT
FAQs
[![npm](https://img.shields.io/npm/v/interval-spans?style=plastic)](https://www.npmjs.com/package/interval-spans)
The npm package interval-spans receives a total of 4 weekly downloads. As such, interval-spans popularity was classified as not popular.
We found that interval-spans 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.