Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sembear

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sembear

> Some friendly semver range utilities

  • 0.5.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
126K
increased by2.37%
Maintainers
1
Weekly downloads
 
Created
Source

🐻sembear

Some friendly semver range utilities

Install

yarn add sembear

Usage

import { contains, highest } from "sembear";

// this checks if rangeB is contained within rangeA
// or if every version that matches rangeB will also match rangeA
// (though there could be versions that match rangeA but not rangeB)
contains(rangeA, rangeB);

contains("^1.0.0", "^1.0.0") === true;
contains("^1.0.0", "^1.2.0") === true;

// this will return the range that has the highest lower bound
// if there are multiple ranges with the highest lower bound
// it will return the range with the highest upper bound
// if there are multiple ranges with the highest upper bound, one of ones ranges will be returned
highest([...ranges]);

highest([">=1.0.0 <3.0.0", ">=2.0.0 <3.0.0"]) === ">=2.0.0 <3.0.0";
highest(["^16.3.0", "^16.8.0"]) === "^16.8.0";
highest([">=16.3.0", "^16.8.0"]) === "^16.8.0";
highest([">1", ">2"]) === ">2";
highest(["*", ">2"]) === ">2";

FAQs

Package last updated on 07 Nov 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc