rangecontain
v1.0.2
Published
Package checks if an range defined by an array is fully or partially contained in another.
Downloads
2
Readme
Range Contained
Description
This is a JavaScript library for performing range checks. It provides a function rangeContain, to check if one range is fully or partially contained in another.
Table of Contents
Installation
To install it, you can use npm:
npm install rangecontain
Usage
You can use the function rangeContain to perform range checks:
const { rangeContain } = require("rangecontain");
const range1 = [2, 5];
const range2 = [3, 8];
console.log("Fully Contained:", rangeContain(range1, range2, "full"));
// Expected true
range1 = [2, 5];
range2 = [4, 7];
console.log("Partially Contained:", rangeContain(range1, range2, "part"));
// Expected true