fregante / fregante/tiny-version-compare

Support more version types

Open
#8 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
21
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Coming from https://github.com/sindresorhus/refined-github/pull/2042#issuecomment-492785932

1. Hotfixes: `1.0.0-hotfix` should be greater than `1.0.0`
```
console.assert(
tinyVersionCompare('1.0.0', '1.0.0-hotfix') === -1,
'-1.0.0 should be lower'
);
```

2. GA (General Availability): `1.0.0-GA` should be greater than `1.0.0-M1`

```
console.assert(
tinyVersionCompare('1.0.0-M1', '1.0.0-GA') === -1,
'1.0.0-M1 should be lower'
);
```

3. RCs and M: `v1.0.0.RC1` should be greater than `v1.0.0.M2`.

```
console.assert(
tinyVersionCompare('v1.0.0.RC1', 'v1.0.0.M1') === -1,
'v1.0.0.M1 should be lower'
);
```

The above assertions fail. Can we add support for `hotfix`, `GA` and `M`?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.