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

find-versions

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

find-versions - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

index.d.ts

8

index.js

@@ -5,11 +5,11 @@ 'use strict';

module.exports = (input, options = {}) => {
if (typeof input !== 'string') {
throw new TypeError(`Expected a string, got ${typeof input}`);
module.exports = (stringWithVersions, options = {}) => {
if (typeof stringWithVersions !== 'string') {
throw new TypeError(`Expected a string, got ${typeof stringWithVersions}`);
}
const reLoose = new RegExp(`(?:${semverRegex().source})|(?:v?(?:\\d+\\.\\d+)(?:\\.\\d+)?)`, 'g');
const matches = input.match(options.loose === true ? reLoose : semverRegex()) || [];
const matches = stringWithVersions.match(options.loose === true ? reLoose : semverRegex()) || [];
return arrayUniq(matches.map(match => match.trim().replace(/^v/, '').replace(/^\d+\.\d+$/, '$&.0')));
};
{
"name": "find-versions",
"version": "3.0.0",
"version": "3.1.0",
"description": "Find semver versions in a string: `unicorn v1.2.3` → `1.2.3`",

@@ -16,6 +16,7 @@ "license": "MIT",

"scripts": {
"test": "xo && ava"
"test": "xo && ava && tsd"
},
"files": [
"index.js"
"index.js",
"index.d.ts"
],

@@ -36,9 +37,10 @@ "keywords": [

"dependencies": {
"array-uniq": "^2.0.0",
"array-uniq": "^2.1.0",
"semver-regex": "^2.0.0"
},
"devDependencies": {
"ava": "^1.0.0-rc.1",
"xo": "^0.23.0"
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
}
}

@@ -28,5 +28,5 @@ # find-versions [![Build Status](https://travis-ci.com/sindresorhus/find-versions.svg?branch=master)](https://travis-ci.com/sindresorhus/find-versions)

### findVersions(input, [options])
### findVersions(stringWithVersions, [options])
#### input
#### stringWithVersions

@@ -33,0 +33,0 @@ Type: `string`

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