package.lib.esm.satisfies.d.ts Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of compare-versions Show documentation
Show all versions of compare-versions Show documentation
Compare semver version strings to find greater, equal or lesser.
The newest version!
/**
* Match [npm semver](https://docs.npmjs.com/cli/v6/using-npm/semver) version range.
*
* @param version Version number to match
* @param range Range pattern for version
* @returns `true` if the version number is within the range, `false` otherwise.
*
* @example
* ```
* satisfies('1.1.0', '^1.0.0'); // return true
* satisfies('1.1.0', '~1.0.0'); // return false
* ```
*/
export declare const satisfies: (version: string, range: string) => boolean;