Reduce with a second param instead of default val
This commit is contained in:
parent
85154ad4c8
commit
b298b74521
|
@ -30,10 +30,10 @@ export default class Command extends Component {
|
||||||
return {
|
return {
|
||||||
command: cmd.name,
|
command: cmd.name,
|
||||||
args: "",
|
args: "",
|
||||||
flags: cmd.flags.reduce((list = {}, flag) => {
|
flags: cmd.flags.reduce((list, flag) => {
|
||||||
list[flag.name] = flag.default
|
list[flag.name] = flag.default
|
||||||
return list
|
return list
|
||||||
})
|
}, {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue