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 4.0.0 to 5.0.0

22

index.d.ts

@@ -1,10 +0,8 @@

declare namespace findVersions {
interface Options {
/**
Also match non-semver versions like `1.88`. They're coerced into semver compliant versions.
export interface Options {
/**
Also match non-semver versions like `1.88`. They're coerced into semver compliant versions.
@default false
*/
readonly loose?: boolean;
}
@default false
*/
readonly loose?: boolean;
}

@@ -17,3 +15,3 @@

```
import findVersions = require('find-versions');
import findVersions from 'find-versions';

@@ -27,7 +25,5 @@ findVersions('unicorn v1.2.3 rainbow 2.3.4+build.1');

*/
declare function findVersions(
export default function findVersions(
stringWithVersions: string,
options?: findVersions.Options
options?: Options
): string[];
export = findVersions;

@@ -1,5 +0,4 @@

'use strict';
const semverRegex = require('semver-regex');
import semverRegex from 'semver-regex';
module.exports = (stringWithVersions, {loose = false} = {}) => {
export default function findVersions(stringWithVersions, {loose = false} = {}) {
if (typeof stringWithVersions !== 'string') {

@@ -13,2 +12,2 @@ throw new TypeError(`Expected a string, got ${typeof stringWithVersions}`);

return [...new Set(matches.map(match => match.trim().replace(/^v/, '').replace(/^\d+\.\d+$/, '$&.0')))];
};
}
{
"name": "find-versions",
"version": "4.0.0",
"version": "5.0.0",
"description": "Find semver versions in a string: `unicorn v1.2.3` → `1.2.3`",

@@ -13,4 +13,6 @@ "license": "MIT",

},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=10"
"node": ">=12"
},

@@ -38,9 +40,9 @@ "scripts": {

"dependencies": {
"semver-regex": "^3.1.2"
"semver-regex": "^4.0.0"
},
"devDependencies": {
"ava": "^2.4.0",
"ava": "^3.15.0",
"tsd": "^0.14.0",
"xo": "^0.36.1"
"xo": "^0.39.1"
}
}

@@ -14,3 +14,3 @@ # find-versions

```js
const findVersions = require('find-versions');
import findVersions from 'find-versions';

@@ -17,0 +17,0 @@ findVersions('unicorn v1.2.3 rainbow 2.3.4+build.1');

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