iteratify
v0.0.1
Published
make object destructable use ...
Downloads
2
Readme
Written with StackEdit.
install
npm i iteratify --save
OR
yarn add iteratify
usage
const iteratify = require('iteratify');
let obj = {
a: 1,
b: /asd/,
c: 'str'
};
iteratify(obj)
//or
obj = iteratify(obj);
console.log([...obj]);
// output
[
{key: 'a', value: 1},
{key: 'b', value: /asd/},
{key: 'c', value: 'str'}
]
const iteratify = require('iteratify');
let obj = {
a: 1,
b: /asd/,
c: 'str'
};
iteratify(obj, {labelKey: 'k', labelValue: 'v'});
console.log([...obj]);
// output
[
{k: 'a', v: 1},
{k: 'b', v: /asd/},
{k: 'c', v: 'str'}
]