Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const makeArticle = configuration => article => {
const configuredArticle = { ...article };
const extraContent = [];
if (!(configuration & FLAGS)) {
configuredArticle.expirableFlags = [];
}
if (!(configuration & HEADLINE)) {
configuredArticle.headline = null;
}
if (configuration & KEY_FACTS) {
configuredArticle.content = [
...configuredArticle.content.slice(0, 2),
fixtures.keyFacts,
...configuredArticle.content.slice(2)
];
}
if (!(configuration & LABEL)) {
configuredArticle.label = null;
}
if (!(configuration & LEAD_ASSET)) {
configuredArticle.leadAsset = null;
}
if (configuration & LINKED_BYLINE) {
configuredArticle.bylines = fixtures.bylineWithLink;
}