UNPKG

973 BTypeScriptView Raw
1import semver from 'semver';
2/**
3 * Returns whether the given semver version satisfies the given range. Notably
4 * this supports prerelease versions so that "2.0.0-rc.0" satisfies the range
5 * ">=1.0.0", for example.
6 *
7 * This function exists because the semver.satisfies method does not include
8 * pre releases. This means ranges such as * would not satisfy 1.0.0-rc. The
9 * includePrerelease flag has a weird behavior and cannot be used (if you want
10 * to try it out, just run the `semverUtils` testsuite using this flag instead
11 * of our own implementation, and you'll see the failing cases).
12 *
13 * See https://github.com/yarnpkg/berry/issues/575 for more context.
14 */
15export declare function satisfiesWithPrereleases(version: string | null, range: string, loose?: boolean): boolean;
16/**
17 * A cached version of `new semver.Range(potentialRange)` that returns `null` on invalid ranges
18 */
19export declare function validRange(potentialRange: string): semver.Range | null;