-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d937b4
commit 247b808
Showing
4 changed files
with
28 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* Very simple semver-ish implementation of the Conduit version | ||
* so we can perform some checks based on its version. | ||
*/ | ||
export default class Version { | ||
public readonly major: number; | ||
public readonly minor: number; | ||
public readonly patch: number; | ||
|
||
constructor(version: string) { | ||
const [major, minor, patch] = version.split("."); | ||
|
||
this.major = +major; | ||
this.minor = +minor; | ||
this.patch = +patch; | ||
} | ||
|
||
greaterThan(major: number, minor: number, patch: number): boolean { | ||
return this.major > major || this.minor > minor || this.patch > patch; | ||
} | ||
} |