| Total Complexity | 7 |
| Complexity/F | 3.5 |
| Lines of Code | 23 |
| Function Count | 2 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | 'use strict' |
||
| 2 | |||
| 3 | const jsonfile = require('jsonfile') |
||
| 4 | const output = require('./output') |
||
| 5 | |||
| 6 | function getManifest (callback) { |
||
| 7 | jsonfile.readFile('module.json', function (err, module) { |
||
| 8 | if (err) { |
||
| 9 | output.err('Error reading module.json: ' + err) |
||
| 10 | return |
||
| 11 | } |
||
| 12 | if (!('slug' in module) || !module.slug || typeof module.slug !== 'string' || !module.slug.length) { |
||
| 13 | output.err('Please set a valid value for module.slug') |
||
| 14 | return |
||
| 15 | } |
||
| 16 | |||
| 17 | callback(module) |
||
| 18 | }) |
||
| 19 | } |
||
| 20 | |||
| 21 | module.exports = { |
||
| 22 | getManifest: getManifest |
||
| 23 | } |
||
| 24 |