MCPcopy
hub / github.com/streamich/git-cz / createState

Function createState

lib/createState.js:4–31  ·  view source on GitHub ↗
(config = {})

Source from the content-addressed store, hash-verified

2const getConfig = require('./getConfig');
3
4const 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
33module.exports = createState;

Callers 2

mainFunction · 0.85
runFunction · 0.85

Calls 2

getGitRootDirFunction · 0.85
getConfigFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…