aboutsummaryrefslogtreecommitdiffstats
path: root/src/models/Recipe.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/Recipe.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/Recipe.ts')
-rw-r--r--src/models/Recipe.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/models/Recipe.ts b/src/models/Recipe.ts
index 0a93fbc5a..6022fb520 100644
--- a/src/models/Recipe.ts
+++ b/src/models/Recipe.ts
@@ -68,16 +68,16 @@ export default class Recipe {
68 // TODO: Need to reconcile which of these are optional/mandatory 68 // TODO: Need to reconcile which of these are optional/mandatory
69 constructor(data: IRecipe) { 69 constructor(data: IRecipe) {
70 if (!data) { 70 if (!data) {
71 throw Error('Recipe config not valid'); 71 throw new Error('Recipe config not valid');
72 } 72 }
73 73
74 if (!data.id) { 74 if (!data.id) {
75 // Ferdi 4 recipes do not have an Id 75 // Ferdi 4 recipes do not have an Id
76 throw Error(`Recipe '${data.name}' requires Id`); 76 throw new Error(`Recipe '${data.name}' requires Id`);
77 } 77 }
78 78
79 if (!semver.valid(data.version)) { 79 if (!semver.valid(data.version)) {
80 throw Error(`Version ${data.version} of recipe '${data.name}' is not a valid semver version`); 80 throw new Error(`Version ${data.version} of recipe '${data.name}' is not a valid semver version`);
81 } 81 }
82 82
83 this.id = data.id || this.id; 83 this.id = data.id || this.id;