flatten
flatten :: Collection -> Collectiondescription
Deeply flattens a Collection (Array | Set | Map | Object).
examples
array
import { flatten } from 'conductor'
const array = [1, [2, [3]]]
flatten(array) // [1, 2, 3]object
import { flatten } from 'conductor'
const object = { a: { b: { c: 3 } } }
flatten(array) // { 'a.b.c': 3 }set
import { flatten } from 'conductor'
const set = new Set([1, [2, [3]]])
flatten(set) // Set{1, 2, 3}map
Last updated