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

ModuleManifest.js ➔ createManifest   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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