Skip to content

Commit bb48a77

Browse files
hsupuulivz
authored andcommitted
fix: skip format data.head if not exist while loading toml config (#707)
1 parent 2e8d69c commit bb48a77

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/prepare/loadConfig.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ function parseConfig (file) {
4141
// reformat to match config since TOML does not allow different data type
4242
// https://github.com/toml-lang/toml#array
4343
const format = []
44-
Object.keys(data.head).forEach(meta => {
45-
data.head[meta].forEach(values => {
46-
format.push([meta, values])
44+
if (data.head) {
45+
Object.keys(data.head).forEach(meta => {
46+
data.head[meta].forEach(values => {
47+
format.push([meta, values])
48+
})
4749
})
48-
})
50+
}
4951
data.head = format
5052
break
5153
}

0 commit comments

Comments
 (0)