diff options
author | Vijay A <avijayr@protonmail.com> | 2021-08-11 21:01:14 +0530 |
---|---|---|
committer | Vijay A <avijayr@protonmail.com> | 2021-08-11 21:01:14 +0530 |
commit | 664b2c5a0523439c9672248b652df858facf7ff2 (patch) | |
tree | bd6e138cd725166dfef1a93cec7b35118b6b3903 /src/models | |
parent | revert: fixing #1757 by commenting out partial fix (diff) | |
download | ferdium-app-664b2c5a0523439c9672248b652df858facf7ff2.tar.gz ferdium-app-664b2c5a0523439c9672248b652df858facf7ff2.tar.zst ferdium-app-664b2c5a0523439c9672248b652df858facf7ff2.zip |
refactor: removed legacy properties from recipes
(Addendum to getferdi/recipes#605)
Diffstat (limited to 'src/models')
-rw-r--r-- | src/models/Recipe.js | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/models/Recipe.js b/src/models/Recipe.js index 92ff0d67d..e616055d6 100644 --- a/src/models/Recipe.js +++ b/src/models/Recipe.js | |||
@@ -1,9 +1,9 @@ | |||
1 | import emailParser from 'address-rfc2822'; | ||
2 | import semver from 'semver'; | 1 | import semver from 'semver'; |
3 | import { pathExistsSync } from 'fs-extra'; | 2 | import { pathExistsSync } from 'fs-extra'; |
4 | import { join } from 'path'; | 3 | import { join } from 'path'; |
5 | 4 | ||
6 | export default class Recipe { | 5 | export default class Recipe { |
6 | // Note: Do NOT change these default values. If they change, then the corresponding changes in the recipes needs to be done | ||
7 | id = ''; | 7 | id = ''; |
8 | 8 | ||
9 | name = ''; | 9 | name = ''; |
@@ -60,8 +60,6 @@ export default class Recipe { | |||
60 | 60 | ||
61 | this.id = data.id || this.id; | 61 | this.id = data.id || this.id; |
62 | this.name = data.name || this.name; | 62 | this.name = data.name || this.name; |
63 | this.rawAuthor = data.author || this.author; | ||
64 | this.description = data.description || this.description; | ||
65 | this.version = data.version || this.version; | 63 | this.version = data.version || this.version; |
66 | this.path = data.path; | 64 | this.path = data.path; |
67 | 65 | ||
@@ -86,14 +84,8 @@ export default class Recipe { | |||
86 | this.message = data.config.message || this.message; | 84 | this.message = data.config.message || this.message; |
87 | } | 85 | } |
88 | 86 | ||
87 | // TODO: Need to remove this if its not used anywhere | ||
89 | get author() { | 88 | get author() { |
90 | try { | ||
91 | const addresses = emailParser.parse(this.rawAuthor); | ||
92 | return addresses.map((a) => ({ email: a.address, name: a.phrase })); | ||
93 | } catch (err) { | ||
94 | console.warn(`Not a valid author for ${this.name}`); | ||
95 | } | ||
96 | |||
97 | return []; | 89 | return []; |
98 | } | 90 | } |
99 | 91 | ||