Last active
May 7, 2021 07:13
-
-
Save Noitidart/6cda735a60b4f9a799d78ab9766bc62b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var { stripIndents } = require("common-tags") | |
const toTitle = ad => ad.title; | |
const ads = [{ title: 'a' }, { title: 'b' }]; | |
function bulletLists(strs, ...lists) { | |
return strs.reduce((compiled, str, ix) => { | |
compiled.push(str); | |
const list = lists[ix]; | |
if (list) { | |
compiled.push('- ' + list.join('\n - ')) | |
} | |
return compiled; | |
}, []).join(''); | |
} | |
function doit() { | |
var a = stripIndents(bulletLists)` | |
Please support your community: | |
${ads.map(toTitle)} | |
(tap here to see more about our sponsors) | |
`; | |
return a; | |
} | |
doit(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment