@citation-js/plugin-doi
Version:
Plugin for DOI input for Citation.js
17 lines • 541 B
JavaScript
const doiTypes = {
'journal-article': 'article-journal',
'book-chapter': 'chapter',
'posted-content': 'manuscript',
'proceedings-article': 'paper-conference',
dissertation: 'thesis'
};
function fetchDoiType(value, data) {
if (value === 'posted-content' && data.subtype === 'preprint') {
return 'article';
}
if (value === 'posted-content' && data.subtype === 'other' && data.member === '31795') {
return 'post-weblog';
}
return doiTypes[value] || value;
}
export { fetchDoiType as parse, fetchDoiType as default };