Call it via:
const flat = flatten( realDeepObject ),
flatDotted = flatten( realDeepObject, '', '.' );
Test case:
# Autocompletion for Vagrant just put this line in your ~/.bashrc | |
complete -W "$(vagrant list-commands | awk 'NR>3 {print $1}')" vagrant |