(config = {})
| 2 | const getConfig = require('./getConfig'); |
| 3 | |
| 4 | const createState = (config = {}) => { |
| 5 | let root; |
| 6 | |
| 7 | try { |
| 8 | root = getGitRootDir(); |
| 9 | } catch (error) { |
| 10 | throw new Error('Could not find Git root folder.'); |
| 11 | } |
| 12 | |
| 13 | const state = { |
| 14 | answers: { |
| 15 | body: '', |
| 16 | breaking: '', |
| 17 | issues: '', |
| 18 | lerna: '', |
| 19 | scope: '', |
| 20 | subject: '', |
| 21 | type: '' |
| 22 | }, |
| 23 | config: { |
| 24 | ...getConfig(root), |
| 25 | ...config |
| 26 | }, |
| 27 | root |
| 28 | }; |
| 29 | |
| 30 | return state; |
| 31 | }; |
| 32 | |
| 33 | module.exports = createState; |
no test coverage detected
searching dependent graphs…