-
Notifications
You must be signed in to change notification settings - Fork 0
/
frameworks.js
39 lines (34 loc) · 875 Bytes
/
frameworks.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const frameworks = {
'vuetify': {
name: 'Vuetify',
version: '^1.3.0',
template: 'vuetify',
},
'bootstrap-vue': {
name: 'Bootstrap Vue',
version: '^2.0.0-rc.11',
template: 'bootstrap',
}
};
function findByCode(code) {
return frameworks[code];
}
function isObject(obj) {
return typeof obj === 'object'
}
module.exports.choices = function () {
return Object.keys(frameworks).map(key => {
return {
name: frameworks[key].name,
value: key,
}
});
};
module.exports.template = function (code) {
const framework = findByCode(code)
return typeof framework === 'object' ? framework.template : undefined;
}
module.exports.version = function (code) {
const framework = findByCode(code)
return isObject(framework) ? framework.version : undefined;
}