We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e99675 commit 5826dc3Copy full SHA for 5826dc3
src/models/Recipe.js
@@ -1,10 +1,11 @@
1
import emailParser from 'address-rfc2822';
2
+import semver from 'semver';
3
4
export default class Recipe {
5
id = '';
6
name = '';
7
description = '';
- version = '1.0';
8
+ version = '';
9
path = '';
10
11
serviceURL = '';
@@ -31,6 +32,10 @@ export default class Recipe {
31
32
throw Error(`Recipe '${data.name}' requires Id`);
33
}
34
35
+ if (!semver.valid(data.version)) {
36
+ throw Error(`Version ${data.version} of recipe '${data.name}' is not a valid semver version`);
37
+ }
38
+
39
this.id = data.id || this.id;
40
this.name = data.name || this.name;
41
this.rawAuthor = data.author || this.author;
0 commit comments