Completed
Push — dev ( 3403e5...41defb )
by Fike
30s
created

lib/Schema/Defaults/Deserializer.js   A

Complexity

Total Complexity 4
Complexity/F 4

Size

Lines of Code 8
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 4
nc 4
mnd 2
bc 3
fnc 1
dl 0
loc 8
rs 10
bpm 3
cpm 4
noi 0
c 1
b 0
f 0
1
module.exports = function (input) {
2
  // TODO: add logging
3
  try {
4
    return !input || input === '' ? {} : JSON.parse(input)
5
  } catch (e) {
6
    return {customData: input}
7
  }
8
}
9