UNPKG

replicake

Version:

A javascript library for the creation and manipulate of recipes.

22 lines (18 loc) 469 B
export default class Recipe { constructor(options) { const defaults = { name: '', author: '', description: '', ingredients: {}, serves: 1, }; const actual = Object.assign({}, defaults, options); if (actual.id) this.id = actual.id; this.name = actual.name; this.author = actual.author; this.description = actual.description; this.ingredients = actual.ingredients; this.serves = actual.serves; } }