find-versions
Advanced tools
Comparing version 4.0.0 to 5.0.0
@@ -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'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Yes
3776
31
+ Addedsemver-regex@4.0.5(transitive)
- Removedsemver-regex@3.1.4(transitive)
Updatedsemver-regex@^4.0.0