From aaf950e2ad5c07d4423f9822e3a0ae9f7b8d2bdf Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 30 Mar 2020 16:09:32 +0530 Subject: re-format with prettier v2, fix HTML --- src/util/libtoolVersion.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/util/libtoolVersion.ts') 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 }; } -- cgit v1.2.3