From 18b8106405048ddcf61d2ba7783493954e73df72 Mon Sep 17 00:00:00 2001 From: Jennie Robinson Faber Date: Sun, 5 Apr 2026 16:13:23 +0100 Subject: [PATCH] fix: use Map for abbreviations to handle mixed-case DevOps label --- scripts/seed-tags.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/seed-tags.js b/scripts/seed-tags.js index ab19ee2..a656ca4 100644 --- a/scripts/seed-tags.js +++ b/scripts/seed-tags.js @@ -12,15 +12,17 @@ import { connectDB } from '../server/utils/mongoose.js' // Convert a slug like "qa-and-testing" to "QA and Testing" // Special-cases common abbreviations. -const ABBREVIATIONS = new Set(['qa', 'ux', 'ui', 'devops']) +const ABBREVIATIONS = new Map([ + ['qa', 'QA'], + ['ux', 'UX'], + ['ui', 'UI'], + ['devops', 'DevOps'], +]) function slugToLabel(slug) { return slug .split('-') - .map((word) => { - if (ABBREVIATIONS.has(word)) return word.toUpperCase() - return word.charAt(0).toUpperCase() + word.slice(1) - }) + .map((word) => ABBREVIATIONS.get(word) ?? word.charAt(0).toUpperCase() + word.slice(1)) .join(' ') }