verb
Version:
A project without documentation is like a project that doesn't exist. Verb solves this by making it dead simple to generate docs, using simple markdown templates, with zero configuration required.
17 lines (15 loc) • 312 B
JavaScript
/**
* Flatten an array and convert it
* to a comma-separated list.
*
* @title listify
* @param {Array} arr [description]
* @api Public
*/
module.exports = function (arr, sep) {
sep = sep || ', ';
do {
arr = [].concat.apply([], arr);
} while(arr.some(Array.isArray));
return arr.join(sep);
};