New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

semver-select

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

semver-select - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

4

changelog.md

@@ -6,1 +6,5 @@ # Changelog

* Initial release
## 1.0.1
* README update

2

package.json
{
"name": "semver-select",
"version": "1.0.0",
"version": "1.0.1",
"description": "Select an attribute of an object based on semver versioning",

@@ -5,0 +5,0 @@ "main": "./lib/",

@@ -17,3 +17,3 @@ # semver-select.js

A few useful tool for when you need to select a function or other variable based on a [semver](https://www.npmjs.com/package/semver) version.
A few useful tools for when you need to select a function or other variable based on a [semver](https://www.npmjs.com/package/semver) version.

@@ -26,5 +26,5 @@ For example, if you are writing an app which interacts with an API which needs a different calling signature depending on it's version, you can use this to choose a function that implements the right interface for that API version.

Takes a list of choices as an object with the semver version for each choice as the object's attributes.
Takes a list of choices as an object with semver match strings as the object's attributes.
Loops through the object's attributes and returns the first matching result.
Loops through `choice`'s attributes and returns the first matching result.
Returns `undefined` if no match found.

@@ -51,14 +51,2 @@

```js
var obj = {
monkey: {
'^1.0.0': 'v1',
'1.0.0 - 2.x.x': 'v2',
'*': 'other'
},
dinosaur: {
'^1.0.0': 'ver1',
'^2.0.0': 'ver2'
}
};
semverSelect('2.3.8', {

@@ -65,0 +53,0 @@ monkey: {

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