Add makeSummaryOfListings helper

This commit is contained in:
Sam Carlton 2022-05-25 13:23:12 -05:00
parent e6f520ca45
commit 021a05ee1c

View file

@ -246,3 +246,10 @@ export function findCategoryForTagsSet ( tags ) {
return null
}
export function makeSummaryOfListings ({ list, length = 25 } = {}) {
return list
.slice(0, length)
.map( listing => listing.name )
.join(', ') + ', etc...'
}