aboutsummaryrefslogtreecommitdiffstats
path: root/src/models/RecipePreview.ts
diff options
context:
space:
mode:
authorLibravatar Markus Hatvan <markus_hatvan@aon.at>2021-09-14 19:58:52 +0200
committerLibravatar GitHub <noreply@github.com>2021-09-14 19:58:52 +0200
commit95df3522a15631abc51a4295cae0ea401a8d4e1e (patch)
treee5eb0f368c947683f01458e912f21756fb0d99cb /src/models/RecipePreview.ts
parentdocs: add sad270 as a contributor for bug, userTesting [skip ci] (#1941) (diff)
downloadferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.tar.gz
ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.tar.zst
ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.zip
feat: add eslint-plugin-unicorn (#1936)
Diffstat (limited to 'src/models/RecipePreview.ts')
-rw-r--r--src/models/RecipePreview.ts6
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
3interface IRecipePreview { 1interface 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);