Total Complexity | 7 |
Complexity/F | 3.5 |
Lines of Code | 22 |
Function Count | 2 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | 'use strict' |
||
2 | |||
3 | const _ = require('lodash') |
||
4 | |||
5 | const ModuleManifest = { |
||
6 | getDevOption: function (option) { |
||
7 | if ('dev' in this && typeof this.dev === 'object' && option in this.dev) { |
||
8 | return this.dev[option] |
||
9 | } |
||
10 | if (option === 'scripts' && option in this) { |
||
11 | return this[option] |
||
12 | } |
||
13 | |||
14 | return null |
||
15 | } |
||
16 | } |
||
17 | |||
18 | const createManifest = function (manifest) { |
||
19 | return _.defaults(manifest, ModuleManifest) |
||
20 | } |
||
21 | |||
22 | module.exports = createManifest |
||
23 |