1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = getDescription;
|
7 |
|
8 | var _lodash = require('lodash');
|
9 |
|
10 | var _lodash2 = _interopRequireDefault(_lodash);
|
11 |
|
12 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13 |
|
14 | const DB = {
|
15 | loader: {
|
16 | get: loader => _lodash2.default.startCase(loader)
|
17 | },
|
18 | ext: {
|
19 | get: ext => `${ext} files`,
|
20 | vue: 'Vue Signle File components',
|
21 | js: 'JavaScript files',
|
22 | sass: 'SASS files',
|
23 | scss: 'SASS files',
|
24 | unknown: 'Unknown files'
|
25 | }
|
26 | };
|
27 |
|
28 | function getDescription(category, keyword) {
|
29 | if (!DB[category]) {
|
30 | return _lodash2.default.startCase(keyword);
|
31 | }
|
32 |
|
33 | if (DB[category][keyword]) {
|
34 | return DB[category][keyword];
|
35 | }
|
36 |
|
37 | if (DB[category].get) {
|
38 | return DB[category].get(keyword);
|
39 | }
|
40 |
|
41 | return '-';
|
42 | } |
\ | No newline at end of file |