Completed
Push — master ( 1abe1d...4b8289 )
by Thomas
46s
created

lib/containers/ModuleManifest.js   A

Complexity

Total Complexity 7
Complexity/F 3.5

Size

Lines of Code 22
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
c 1
b 0
f 0
nc 1
dl 0
loc 22
rs 10
wmc 7
mnd 1
bc 4
fnc 2
bpm 2
cpm 3.5
noi 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A ModuleManifest.js ➔ createManifest 0 3 1
B ModuleManifest.getDevOption 0 10 6
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