From 291b20be3e037b2a2cef7f34186c08d9da15e5a8 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 13 Apr 2026 16:50:58 +0200 Subject: [PATCH] catalog-backend: remove unused parseIntegerParam and parseStringParam Signed-off-by: Patrik Oldsberg Made-with: Cursor --- .../src/service/request/common.ts | 42 ------------------- 1 file changed, 42 deletions(-) diff --git a/plugins/catalog-backend/src/service/request/common.ts b/plugins/catalog-backend/src/service/request/common.ts index 3e028349f1..5e3da47182 100644 --- a/plugins/catalog-backend/src/service/request/common.ts +++ b/plugins/catalog-backend/src/service/request/common.ts @@ -16,48 +16,6 @@ import { InputError } from '@backstage/errors'; -/** - * Takes a single unknown parameter and makes sure that it's a string that can - * be parsed as an integer. - */ -export function parseIntegerParam( - param: unknown, - ctx: string, -): number | undefined { - if (param === undefined) { - return undefined; - } - - if (typeof param !== 'string') { - throw new InputError(`Invalid ${ctx}, not an integer on string form`); - } - - const parsed = parseInt(param, 10); - if (!Number.isInteger(parsed) || String(parsed) !== param) { - throw new InputError(`Invalid ${ctx}, not an integer`); - } - - return parsed; -} - -/** - * Takes a single unknown parameter and makes sure that it's a string. - */ -export function parseStringParam( - param: unknown, - ctx: string, -): string | undefined { - if (param === undefined) { - return undefined; - } - - if (typeof param !== 'string') { - throw new InputError(`Invalid ${ctx}, not a string`); - } - - return param; -} - /** * Takes a single unknown parameter and makes sure that it's a single string or * an array of strings, and returns as an array.