You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
468 B

2 years ago
  1. "use strict"
  2. module.exports = function (parentMedia, childMedia) {
  3. if (!parentMedia.length && childMedia.length) return childMedia
  4. if (parentMedia.length && !childMedia.length) return parentMedia
  5. if (!parentMedia.length && !childMedia.length) return []
  6. const media = []
  7. parentMedia.forEach(parentItem => {
  8. childMedia.forEach(childItem => {
  9. if (parentItem !== childItem) media.push(`${parentItem} and ${childItem}`)
  10. })
  11. })
  12. return media
  13. }