| Total Complexity | 2 |
| Complexity/F | 1 |
| Lines of Code | 20 |
| Function Count | 2 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 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 |