UNPKG

recipez

Version:

Import recipes from cooking sites to your cookbook

18 lines (13 loc) 410 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.toRecipe = void 0; const toRecipe = structuredData => { let recipe = Array.isArray(structuredData) ? structuredData.find(sdata => sdata['@type'] === 'Recipe') : structuredData['@graph'].find(sdata => sdata['@type'] === 'Recipe'); if (!recipe) { return null; } return recipe; }; exports.toRecipe = toRecipe;