_.chain(fs.readdirSync(absPath)) .filter(file => file.match(/\.svg$/)) .map(file => { const fileParts = file.split('.'); const name = fileParts.length < 2 ? file : _.initial(fileParts).join('.'); const shortname = name .toLowerCase() .replace(/[!|’|.| |-]/g, '') .replace(/[+]/, 'plus'); return { shortname, name, url: 'http://instantlogosearch.com', path: path.join('instantlogos', 'logos', file) }; }) .value()
resources = _.flatten(_.initial(args), true); callback = _.last(args);