satisfiesRange
Checks if a version satisfies a range (simple implementation)
Available since v1.9.0
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
version | string | Version to check |
range | string | Range pattern (e.g., ”>=1.0.0”, “~1.2.0”, “^1.0.0”) |
Returns
Section titled “Returns”boolean — True if version satisfies the range
Examples
Section titled “Examples”Check caret range
Section titled “Check caret range”Caret (^) allows patch and minor updates within the same major.
Check greater-than-or-equal range
Section titled “Check greater-than-or-equal range”The >= operator checks if the version is at least the specified value.
Out of range
Section titled “Out of range”Returns false when the version does not satisfy the range.
