Forest Logo
search
package_2

carrot

By @griffin-dalby

Roblox

Mirrored from Wally

This version ships no README. Showing the README from v0.1.0, mirrored from wally.

carrot 🥕

Lightweight & efficient semver parsing & range matching for LuaU. All syntax and comparison ideology is derived from NPM semver syntax. Specifics are listed in the cheatsheet.

API

Cheatsheet

Range parsing syntax

RangeComparisonNotes
~1.2.3is >=1.2.3 <1.3.0
^1.2.3is >=1.2.3 <2.0.0
^0.2.3is >=0.2.3 <0.3.0
^0.0.1is ==0.0.1
^1.2is >=1.2.0 <2.0.0(like ^1.2.0)
~1.2is >=1.2.0 <1.3.0(like ~1.2.0)
^1is >1.0.0 <2.0.0
1.xsame
1same
*any version
xsame

Wildcard Explanation

Wildcards act as placeholders in version strings, any place that has a wildcard will be replaced with a zero.

WildcardExampleFinal
x1.x.x1.0.0
X3.2.X3.2.0
*2.*2.0.0

Partial Explanation

When a version is "partial", is does not have all three places. The missing places will be replaced with zeros.

PartialFinal
1.21.2.0
2.52.5.0

Operator Explanation

Operators are used specifically when defining what ranges are needed. It acts as a shorthand for defining a specific range.

OperatorDescription
^means "compatible with"
~means "reasonably close to"

License

This framework (carrot) is licensed under MIT, meaning you can implement this into your project in any way that you see fit, but attributions to me within any files must be kept.

Package Details

Install command (Click to copy)


Version

0.2.3

License

MIT

check_circle

Safe for commercial use

infoLicense identified from the packaged LICENSE file; the manifest declared none.

Automated license review — not legal advice.