Add method to DSL to flatten a nested array