From 1425be7d8f8f1109a8903757dc41bd9681b8b8b9 Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Sun, 13 Feb 2022 19:41:47 +0100 Subject: [PATCH 1/2] ci: add explicit typecheck step --- .gitlab-ci.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 41d69ac4..5b8ffa8b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ image: node:lts stages: - - test + - check - build - prepare-release - release @@ -17,7 +17,7 @@ cache: &global_cache - .yarn/cache lint: - stage: test + stage: check before_script: - yarn install --immutable script: @@ -25,8 +25,17 @@ lint: cache: <<: *global_cache +typecheck: + stage: check + before_script: + - yarn install --immutable + script: + - yarn typecheck + cache: + <<: *global_cache + test: - stage: test + stage: check before_script: - yarn install --immutable script: @@ -40,7 +49,7 @@ test: - junit.xml reuse: - stage: test + stage: check image: name: fsfe/reuse:latest entrypoint: [""] From 312c79ebe6588651ab5280b22a1c33d828ba79b9 Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Sun, 13 Feb 2022 19:46:49 +0100 Subject: [PATCH 2/2] build: fix build --- src/item/type-specific-helpers/spell.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/item/type-specific-helpers/spell.ts b/src/item/type-specific-helpers/spell.ts index e8820b43..5af27f20 100644 --- a/src/item/type-specific-helpers/spell.ts +++ b/src/item/type-specific-helpers/spell.ts @@ -19,21 +19,22 @@ export function calculateSpellPrice(data: DS4SpellDataSourceData): number | null function calculateSpellPriceFactor(temporalData: UnitData): number { let days: number; if (Number.isNumeric(temporalData.value)) { + const value = Number.fromString(temporalData.value); switch (temporalData.unit) { case "days": { - days = temporalData.value; + days = value; break; } case "hours": { - days = temporalData.value / hoursPerDay; + days = value / hoursPerDay; break; } case "minutes": { - days = temporalData.value / (hoursPerDay * minutesPerHour); + days = value / (hoursPerDay * minutesPerHour); break; } case "rounds": { - days = (temporalData.value * secondsPerRound) / (hoursPerDay * minutesPerHour * secondsPerMinute); + days = (value * secondsPerRound) / (hoursPerDay * minutesPerHour * secondsPerMinute); break; } }