aboutsummaryrefslogtreecommitdiff
path: root/src/util/libtoolVersion.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-03-30 16:09:32 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-03-30 16:09:32 +0530
commitaaf950e2ad5c07d4423f9822e3a0ae9f7b8d2bdf (patch)
tree9274139660f30c4857d80044eb4ac283aac1775a /src/util/libtoolVersion.ts
parent15e18440dbad55df19977a2eb7053681259afc18 (diff)
downloadwallet-core-aaf950e2ad5c07d4423f9822e3a0ae9f7b8d2bdf.tar.xz
re-format with prettier v2, fix HTML
Diffstat (limited to 'src/util/libtoolVersion.ts')
-rw-r--r--src/util/libtoolVersion.ts18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/util/libtoolVersion.ts b/src/util/libtoolVersion.ts
index cc2435b94..5e9d0b74e 100644
--- a/src/util/libtoolVersion.ts
+++ b/src/util/libtoolVersion.ts
@@ -19,7 +19,6 @@
* See https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html
*/
-
/**
* Result of comparing two libtool versions.
*/
@@ -44,7 +43,10 @@ interface Version {
/**
* Compare two libtool-style version strings.
*/
-export function compare(me: string, other: string): VersionMatchResult|undefined {
+export function compare(
+ me: string,
+ other: string,
+): VersionMatchResult | undefined {
const meVer = parseVersion(me);
const otherVer = parseVersion(other);
@@ -52,16 +54,16 @@ export function compare(me: string, other: string): VersionMatchResult|undefined
return undefined;
}
- const compatible = (meVer.current - meVer.age <= otherVer.current &&
- meVer.current >= (otherVer.current - otherVer.age));
+ const compatible =
+ meVer.current - meVer.age <= otherVer.current &&
+ meVer.current >= otherVer.current - otherVer.age;
const currentCmp = Math.sign(meVer.current - otherVer.current);
- return {compatible, currentCmp};
+ return { compatible, currentCmp };
}
-
-function parseVersion(v: string): Version|undefined {
+function parseVersion(v: string): Version | undefined {
const [currentStr, revisionStr, ageStr, ...rest] = v.split(":");
if (rest.length !== 0) {
return undefined;
@@ -82,5 +84,5 @@ function parseVersion(v: string): Version|undefined {
return undefined;
}
- return {current, revision, age};
+ return { current, revision, age };
}