(raw: string | undefined)
| 172 | } |
| 173 | |
| 174 | function parseRawRecipe(raw: string | undefined): RecipeValue | undefined { |
| 175 | if (!raw) return undefined |
| 176 | |
| 177 | try { |
| 178 | const parsed = JSON.parse(raw) |
| 179 | return isRecord(parsed) ? parsed : undefined |
| 180 | } catch { |
| 181 | return undefined |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | function getRecipeSource(part?: StructuredRecipePart): RecipeValue | undefined { |
| 186 | if (!part) return undefined |
no test coverage detected