entries-join

Join values of entries into string, like Array.join().


Keywords
entries, join
License
MIT
Install
npm install entries-join@0.1.5

Documentation

entries-join

NPM

Join values of entries into string, like Array.join().

const join = require('entries-join');
// join(<entries>, [format=%k=%v], [separator=,], [start index=0], [values target])

join(new Map().set('a', 'from').set('b', '1985').entries());
// 'a=from,b=1985'
join(Object.entries({a: 'to', b: '1955'}), "%k = '%v'");
// "a = 'to',b = '1955'"
join(Object.entries({a: 'the', b: 'future'}), '%k = $%i', ' OR ', 1);
// "a = $1 OR b = $2"
join(Object.entries({a: 'back', b: 'to'}), '%k = $%i', ' AND ', 1, val=[]);
// "a = $1 AND b = $2", val = ["back", "to"]