@timshel_npm/maildev
Version:
SMTP Server with async API and Web Interface for viewing and testing emails during development
17 lines (16 loc) • 469 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.calculateBcc = calculateBcc;
/**
* Filter out addresses from recipients, the remaining are the bcc.
*/
function calculateBcc(recipients, to, cc) {
const bcc = [...recipients];
to.concat(cc).forEach((ea) => {
const index = bcc.findIndex((e) => ea.address === e.address);
if (index > -1) {
bcc.splice(index, 1);
}
});
return bcc;
}