ts-flatten
v0.0.1
Published
A utility function that takes in a value and returns a flatted version of that value
Downloads
4
Maintainers
Readme
ts-flatten
A utility function that takes in a value and returns a flatted version of that value
Installation
npm install ts-flatten
Usage
const param = new Map([
[[[[1, 2, 3, 4], new Set()]]],
['a', 1],
['b', null],
['c', { a: 1, b: 2 }],
]);
flatten(param);
/*
Output:
Map(4) {
[ 1, 2, 3, 4 ] => Set(0) {}
'a' => 1,
'b' => null,
'c' => { a: 1, b: 2 },
}
*/