diff options
Diffstat (limited to 'src/models/RecipePreview.ts')
-rw-r--r-- | src/models/RecipePreview.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/models/RecipePreview.ts b/src/models/RecipePreview.ts index 4d2cc8450..fb8cb3e3e 100644 --- a/src/models/RecipePreview.ts +++ b/src/models/RecipePreview.ts | |||
@@ -1,5 +1,3 @@ | |||
1 | // @flow | ||
2 | |||
3 | interface IRecipePreview { | 1 | interface IRecipePreview { |
4 | id: string; | 2 | id: string; |
5 | name: string; | 3 | name: string; |
@@ -21,11 +19,11 @@ export default class RecipePreview { | |||
21 | 19 | ||
22 | constructor(data: IRecipePreview) { | 20 | constructor(data: IRecipePreview) { |
23 | if (!data) { | 21 | if (!data) { |
24 | throw Error('RecipePreview config not valid'); | 22 | throw new Error('RecipePreview config not valid'); |
25 | } | 23 | } |
26 | 24 | ||
27 | if (!data.id) { | 25 | if (!data.id) { |
28 | throw Error(`RecipePreview '${data.name}' requires Id`); | 26 | throw new Error(`RecipePreview '${data.name}' requires Id`); |
29 | } | 27 | } |
30 | 28 | ||
31 | Object.assign(this, data); | 29 | Object.assign(this, data); |