From a96e98a7eee186f6f5488d4f8c85ba36a30676ae Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Fri, 14 Jun 2019 16:27:28 -0400 Subject: [PATCH] Allows versions without a patch --- src/system/version.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/system/version.ts b/src/system/version.ts index bc7d76d..92fb3d9 100644 --- a/src/system/version.ts +++ b/src/system/version.ts @@ -33,13 +33,13 @@ export namespace Versions { export function from( major: string | number, minor: string | number, - patch: string | number, + patch?: string | number, pre?: string ): Version { return { major: typeof major === 'string' ? parseInt(major, 10) : major, minor: typeof minor === 'string' ? parseInt(minor, 10) : minor, - patch: typeof patch === 'string' ? parseInt(patch, 10) : patch, + patch: patch == null ? 0 : typeof patch === 'string' ? parseInt(patch, 10) : patch, pre: pre }; }