src/input.js   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 20
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 13
mnd 0
bc 0
fnc 2
dl 0
loc 20
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
1
module.exports = (input, callback) => {
2
	const validate = require('./validate')
3
	let error = null
4
	let output
5
6
	validate(input, (validatedInput, thrownError) => {
7
		input = validatedInput
8
		error = thrownError
9
	})
10
11
	output = {
12
		'version': {'ref': 'input'},
13
		'metadata': [
14
			{'name': 'topic', 'value': 'Hulk Hogan'},
15
			{'name': 'timestamp', 'value': Date.now().toString()}
16
		]
17
	}
18
19
	callback(error, output)
20
}
21