From a43a5924c7583c0c218c1d23c2159fdb201452fb Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 23 Jul 2024 20:23:30 +0200 Subject: [PATCH] Improve typing --- src/composables/plotTemplates.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/composables/plotTemplates.ts b/src/composables/plotTemplates.ts index 9fecdb49..1cb98813 100644 --- a/src/composables/plotTemplates.ts +++ b/src/composables/plotTemplates.ts @@ -1,4 +1,4 @@ -import { PlotConfig, PlotConfigTemplate } from '@/types'; +import { IndicatorConfig, PlotConfig, PlotConfigTemplate } from '@/types'; const plotTemplates = ref({ BollingerBands: { @@ -41,13 +41,12 @@ const plotTemplates = ref({ }); function replaceTemplateColumns(template: Partial, nameMap: Record) { - // Replace column names in the template with the actual column names // Replace the keys of all elements in main_plot const newTemplate = deepClone(template); if (!nameMap) { return newTemplate; } - const newMainPlot: Record = {}; + const newMainPlot: Record = {}; for (const key in template.main_plot) { const newKey = nameMap[key] || key; newMainPlot[newKey] = template.main_plot[key]; @@ -57,9 +56,9 @@ function replaceTemplateColumns(template: Partial, nameMap: Record = {}; + const newSubplots: Record> = {}; for (const subplotKey in template.subplots) { - const newSubplot: Record = {}; + const newSubplot: Record = {}; for (const key in template.subplots[subplotKey]) { const newKey = nameMap[key] || key; newSubplot[newKey] = template.subplots[subplotKey][key];