fix: Add type annotations for better type safety in recipe parsers

This commit is contained in:
Nils-Johan Gynther
2026-04-12 09:41:35 +02:00
parent 4e2616fe2e
commit 0e18f382c8
2 changed files with 6 additions and 6 deletions
@@ -25,7 +25,7 @@ export class GenericRecipeParser extends RecipeParser {
const recipe =
jsonData['@type'] === 'Recipe'
? jsonData
: jsonData['@graph']?.find((item) => item['@type'] === 'Recipe');
: jsonData['@graph']?.find((item: any) => item['@type'] === 'Recipe');
if (recipe) {
console.log('[GenericParser] ✓ JSON-LD data found');
@@ -59,12 +59,12 @@ export class GenericRecipeParser extends RecipeParser {
instructions = recipe.recipeInstructions;
} else if (Array.isArray(recipe.recipeInstructions)) {
instructions = recipe.recipeInstructions
.map((step) => {
.map((step: any) => {
if (typeof step === 'string') return step;
if (step.text) return step.text;
return '';
})
.filter((s) => s)
.filter((s: string) => s)
.join('\n\n');
}
}