/
index.js
48 lines (38 loc) 路 1.09 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// @flow
import { CONFIG, EMOJI_COMMIT_FORMATS } from '@constants/configuration'
import getConfiguration from './getConfiguration'
const configuration = getConfiguration()
const setAutoAdd = (autoAdd: boolean): void => {
configuration.set(CONFIG.AUTO_ADD, autoAdd)
}
const setEmojiFormat = (emojiFormat: string): void => {
configuration.set(CONFIG.EMOJI_FORMAT, emojiFormat)
}
const setScopePrompt = (scopePrompt: boolean): void => {
configuration.set(CONFIG.SCOPE_PROMPT, scopePrompt)
}
const setGitmojisUrl = (gitmojisUrl: string): void => {
configuration.set(CONFIG.GITMOJIS_URL, gitmojisUrl)
}
const getAutoAdd = (): boolean => {
return configuration.get(CONFIG.AUTO_ADD)
}
const getEmojiFormat = (): string => {
return configuration.get(CONFIG.EMOJI_FORMAT)
}
const getScopePrompt = (): boolean => {
return configuration.get(CONFIG.SCOPE_PROMPT)
}
const getGitmojisUrl = (): string => {
return configuration.get(CONFIG.GITMOJIS_URL)
}
export default {
getAutoAdd,
getEmojiFormat,
getScopePrompt,
getGitmojisUrl,
setAutoAdd,
setEmojiFormat,
setScopePrompt,
setGitmojisUrl
}