Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
refactor(w3c/headers): use object spread props
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoscaceres authored and Marcos Cáceres committed Jun 16, 2017
1 parent be800eb commit feeba94
Showing 1 changed file with 21 additions and 24 deletions.
45 changes: 21 additions & 24 deletions src/w3c/headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,15 +370,14 @@ const baseLogo = Object.freeze({
});

export function run(conf, doc, cb) {
// TODO: mode to w3c defaults
// TODO: move to w3c defaults
if (!conf.logos) {
conf.logos = [
Object.assign({}, baseLogo, {
alt: "W3C",
href: "https://www.w3.org/",
src: "https://www.w3.org/StyleSheets/TR/2016/logos/W3C",
}),
];
const W3CLogo = {
alt: "W3C",
href: "https://www.w3.org/",
src: "https://www.w3.org/StyleSheets/TR/2016/logos/W3C",
};
conf.logos = [{ ...baseLogo, ...W3CLogo }];
}
// Default include RDFa document metadata
if (conf.doRDFa === undefined) conf.doRDFa = true;
Expand Down Expand Up @@ -419,25 +418,23 @@ export function run(conf, doc, cb) {
: recTrackStatus.includes(conf.specStatus);
conf.isMemberSubmission = conf.specStatus === "Member-SUBM";
if (conf.isMemberSubmission) {
conf.logos.push(
Object.assign({}, baseLogo, {
alt: "W3C Member Submission",
href: "https://www.w3.org/Submission/",
src: "https://www.w3.org/Icons/member_subm-v.svg",
width: "211",
})
);
const memSubmissionLogo = {
alt: "W3C Member Submission",
href: "https://www.w3.org/Submission/",
src: "https://www.w3.org/Icons/member_subm-v.svg",
width: "211",
};
conf.logos.push({ ...baseLogo, ...memSubmissionLogo });
}
conf.isTeamSubmission = conf.specStatus === "Team-SUBM";
if (conf.isTeamSubmission) {
conf.logos.push(
Object.assign({}, baseLogo, {
alt: "W3C Team Submission",
href: "https://www.w3.org/TeamSubmission/",
src: "https://www.w3.org/Icons/team_subm-v.svg",
width: "211",
})
);
const teamSubmissionLogo = {
alt: "W3C Team Submission",
href: "https://www.w3.org/TeamSubmission/",
src: "https://www.w3.org/Icons/team_subm-v.svg",
width: "211",
};
conf.logos.push({ ...baseLogo, ...teamSubmissionLogo });
}
conf.isSubmission = conf.isMemberSubmission || conf.isTeamSubmission;
conf.anOrA = precededByAn.includes(conf.specStatus) ? "an" : "a";
Expand Down

0 comments on commit feeba94

Please sign in to comment.