@citation-js/plugin-doi
Version:
Plugin for DOI input for Citation.js
22 lines (21 loc) • 610 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.parse = fetchDoiType;
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;
}