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

ModuleManifest.getDevOption   B

Complexity

Conditions 6
Paths 3

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 6
c 1
b 0
f 0
nc 3
nop 1
dl 0
loc 10
rs 8.8571
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