0.0.1 • Published 5 years ago

iteratify v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

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'}
]