Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
DOI: pubData.doi,
// ISSN: pubData.doi ? (communityData.issn || '2471–2388') : null,
ISSN: pubData.doi ? communityData.issn : null,
issued: [
{
'date-parts': [
pubIssuedDate.getFullYear(),
pubIssuedDate.getMonth() + 1,
pubIssuedDate.getDate(),
],
},
],
note: pubLink,
URL: pubLink,
});
const versionCiteObject = new Cite({
...commonData,
id: pubData.activeVersion ? pubData.activeVersion.id : 'Draft',
DOI:
pubData.doi && pubData.activeVersion.id
? `${pubData.doi}/${pubData.activeVersion.id.split('-')[0]}`
: null,
// ISSN: pubData.doi ? (communityData.issn || '2471–2388') : null,
ISSN: pubData.doi ? communityData.issn : null,
issued: [
{
'date-parts': [
versionIssuedDate.getFullYear(),
versionIssuedDate.getMonth() + 1,
versionIssuedDate.getDate(),
],
},
return 0;
})
.map((attribution) => {
return {
given: attribution.user.firstName,
family: attribution.user.lastName,
};
});
const authorsEntry = authorData.length ? { author: authorData } : {};
const commonData = {
type: 'article-journal',
title: pubData.title,
...authorsEntry,
'container-title': communityData.title,
};
const pubCiteObject = new Cite({
...commonData,
id: pubData.id,
DOI: pubData.doi,
// ISSN: pubData.doi ? (communityData.issn || '2471–2388') : null,
ISSN: pubData.doi ? communityData.issn : null,
issued: [
{
'date-parts': [
pubIssuedDate.getFullYear(),
pubIssuedDate.getMonth() + 1,
pubIssuedDate.getDate(),
],
},
],
note: pubLink,
URL: pubLink,
let citationMLA = cData.map(data => {
let json = this.parseCitation(data)
let cite = new Cite(json)
return cite.format("bibliography", {
format: "html",
template: "mla"
})
})
let citationAPA = cData.map(data => {
let cite = new Cite()
let json = this.parseCitation(data)
return cite.set(json).get(opt)
})
if (cData.itemtype != null) {
let itemtype = cData.itemtype
if (cData.itemtype == "article") {
itemtype = "article-journal"
}
json.type = itemtype
}
if (cData.volume != null) {
json.volume = cData.volume
}
return Cite.parse.csl([json])
}
default:return;break;
}
});
}
buildCHI = () => {
let cData = this.props.data
Cite.CSL.register.addTemplate("chicago", chicago)
if (!Array.isArray(cData)) {
cData = [cData]
}
let citationCHI = cData.map(data => {
let json = this.parseCitation(data)
let cite = new Cite(json)
return cite.format("bibliography", {
format: "html",
template: "chicago"
})
})
return citationCHI.join("")
buildMLA = () => {
let cData = this.props.data
Cite.CSL.register.addTemplate("mla", mla)
if (!Array.isArray(cData)) {
cData = [cData]
}
let citationMLA = cData.map(data => {
let json = this.parseCitation(data)
let cite = new Cite(json)
return cite.format("bibliography", {
format: "html",
template: "mla"
})
})
return citationMLA.join("")
})
.map((attribution) => {
return {
given: attribution.user.firstName,
family: attribution.user.lastName,
};
});
const authorsEntry = authorData.length ? { author: authorData } : {};
const commonData = {
type: 'article-journal',
title: pubData.title,
...authorsEntry,
'container-title': communityData.title,
...getCollectionLevelData(primaryCollectionPub),
};
const pubCiteObject = await Cite.async({
...commonData,
id: pubData.id,
DOI: pubData.doi,
ISSN: pubData.doi ? communityData.issn : null,
issued: pubIssuedDate && [getDatePartsObject(pubIssuedDate)],
note: pubLink,
URL: pubLink,
});
return {
pub: {
apa: pubCiteObject
.get({ format: 'string', type: 'html', style: 'citation-apa', lang: 'en-US' })
.replace(/\n/gi, ''),
harvard: pubCiteObject
.get({ format: 'string', type: 'html', style: 'citation-harvard', lang: 'en-US' })