New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@citation-js/plugin-bibtex

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@citation-js/plugin-bibtex - npm Package Compare versions

Comparing version 0.5.7 to 0.6.0

lib-mjs/mapping/crossref.js

86

lib-mjs/mapping/biblatex.js

@@ -51,2 +51,19 @@ import { util } from '@citation-js/core';

}
}, {
source: 's2id',
target: 'custom',
convert: {
toTarget(S2ID) {
return {
S2ID
};
},
toSource({
S2ID
}) {
return [S2ID];
}
}
}];

@@ -151,3 +168,3 @@ const aliases = [{

type(type) {
return !type.startsWith('article');
return !type || !type.startsWith('article');
}

@@ -223,3 +240,3 @@

if (!typeKey) {
if (type === 'masterthesis') {
if (type === 'mastersthesis') {
typeKey = 'mathesis';

@@ -237,3 +254,3 @@ }

return [types.source[type] || 'book', typeKey || subtype];
return [types.source[type] || 'document', typeKey || subtype];
},

@@ -268,7 +285,18 @@

}, {
source: 'eventtitle',
target: 'event'
source: ['eventtitle', 'eventtitleaddon'],
target: 'event-title',
convert: Converters.EVENT_TITLE
}, {
source: ['eventtitle', 'eventtitleaddon'],
target: 'event',
convert: Converters.EVENT_TITLE,
when: {
source: false,
target: {
'event-title': false
}
}
}, {
source: LABEL,
target: ['id', 'citation-label', 'author', 'issued', 'year-suffix', 'title'],
target: ['id', 'citation-key', 'author', 'issued', 'year-suffix', 'title'],
convert: Converters.LABEL

@@ -294,3 +322,3 @@ }, {

type: ['article', 'article-journal', 'article-newspaper', 'article-magazine']
type: ['article', 'article-journal', 'article-newspaper', 'article-magazine', 'periodical']
}

@@ -310,3 +338,3 @@ }

type: ['article', 'article-journal', 'article-newspaper', 'article-magazine', 'paper-conference']
type: ['article', 'article-journal', 'article-newspaper', 'article-magazine', 'paper-conference', 'periodical']
}

@@ -351,2 +379,10 @@ }

}, {
source: 'eid',
target: 'number',
when: {
target: {
type: ['article-journal']
}
}
}, {
source: ['isan', 'ismn', 'isrn', 'iswc'],

@@ -396,14 +432,10 @@ target: 'number',

}, {
source: ['pages', 'eid'],
source: 'pages',
target: 'page',
convert: {
toTarget(pages, eid) {
return eid ? eid.replace(/^e?/i, 'e') : pages.replace(/[–—]/, '-');
},
toSource(page) {
return /^e/i.test(page) ? [page, page] : [page.replace('-', '--')];
when: {
source: {
bookpagination: [undefined, 'page']
}
}
},
convert: Converters.PAGES
}, {

@@ -413,2 +445,5 @@ source: 'pagetotal',

}, {
source: 'part',
target: 'part-number'
}, {
source: ['eprint', 'eprinttype'],

@@ -428,3 +463,3 @@ target: 'PMID',

target: {
type: ['article', 'article-journal', 'article-magazine', 'article-newspaper', 'bill', 'book', 'broadcast', 'chapter', 'dataset', 'entry', 'entry-dictionary', 'entry-encyclopedia', 'figure', 'graphic', 'interview', 'legal_case', 'legislation', 'manuscript', 'map', 'motion_picture', 'musical_score', 'pamphlet', 'paper-conference', 'patent', 'personal_communication', 'post', 'post-weblog', 'regulation', 'review', 'review-book', 'song', 'speech', 'treaty']
type: ['article', 'article-journal', 'article-magazine', 'article-newspaper', 'bill', 'book', 'broadcast', 'chapter', 'classic', 'collection', 'dataset', 'document', 'entry', 'entry-dictionary', 'entry-encyclopedia', 'event', 'figure', 'graphic', 'hearing', 'interview', 'legal_case', 'legislation', 'manuscript', 'map', 'motion_picture', 'musical_score', 'pamphlet', 'paper-conference', 'patent', 'performance', 'periodical', 'personal_communication', 'post', 'post-weblog', 'regulation', 'review', 'review-book', 'software', 'song', 'speech', 'standard', 'treaty']
}

@@ -500,2 +535,11 @@ }

}, {
source: 'shorttitle',
target: 'shortTitle',
when: {
source: false,
target: {
'title-short': false
}
}
}, {
source: ['title', 'subtitle', 'titleaddon'],

@@ -530,2 +574,6 @@ target: 'title',

target: 'number-of-volumes'
}, {
source: ['issuetitle', 'issuesubtitle', 'issuetitleaddon'],
target: 'volume-title',
convert: Converters.TITLE
}]);

@@ -13,5 +13,7 @@ {

"dataset": "dataset",
"manual": "report",
"misc": "document",
"online": "webpage",
"patent": "patent",
"periodical": "article-journal",
"periodical": "periodical",
"proceedings": "book",

@@ -24,3 +26,3 @@ "mvproceedings": "book",

"report": "report",
"software": "book",
"software": "software",
"thesis": "thesis",

@@ -37,3 +39,5 @@ "unpublished": "manuscript",

"music": "musical_score",
"performance": "performance",
"review": "review",
"standard": "standard",
"video": "motion_picture",

@@ -56,8 +60,13 @@ "conference": "paper-conference",

"chapter": "inbook",
"classic": "unpublished",
"collection": "misc",
"dataset": "dataset",
"document": "misc",
"entry": "inreference",
"entry-dictionary": "inreference",
"entry-encyclopedia": "inreference",
"event": "misc",
"figure": "artwork",
"graphic": "artwork",
"hearing": "legal",
"interview": "audio",

@@ -71,10 +80,15 @@ "legal_case": "jurisdiction",

"patent": "patent",
"performance": "performance",
"periodical": "periodical",
"personal_communication": "letter",
"post": "online",
"post-weblog": "online",
"regulation": "legal",
"report": "report",
"review": "review",
"review-book": "review",
"software": "software",
"song": "music",
"speech": "audio",
"standard": "standard",
"thesis": "thesis",

@@ -81,0 +95,0 @@ "treaty": "legal",

@@ -76,3 +76,3 @@ import { util } from '@citation-js/core';

source: LABEL,
target: ['id', 'citation-label', 'author', 'issued', 'year-suffix', 'title'],
target: ['id', 'citation-key', 'author', 'issued', 'year-suffix', 'title'],
convert: Converters.LABEL

@@ -91,3 +91,3 @@ }, {

type: ['article', 'article-journal', 'article-newspaper', 'article-magazine', 'paper-conference']
type: ['article', 'article-journal', 'article-newspaper', 'article-magazine', 'paper-conference', 'periodical']
}

@@ -116,12 +116,3 @@ }

target: 'page',
convert: {
toTarget(text) {
return text.replace(/[–—]/, '-');
},
toSource(text) {
return text.replace('-', '--');
}
}
convert: Converters.PAGES
}, {

@@ -133,3 +124,3 @@ source: 'publisher',

target: {
type: ['article', 'article-journal', 'article-magazine', 'article-newspaper', 'bill', 'book', 'broadcast', 'chapter', 'dataset', 'entry', 'entry-dictionary', 'entry-encyclopedia', 'figure', 'graphic', 'interview', 'legal_case', 'legislation', 'map', 'motion_picture', 'musical_score', 'pamphlet', 'patent', 'personal_communication', 'post', 'post-weblog', 'review', 'review-book', 'song', 'speech', 'treaty', 'webpage']
type: ['article', 'article-journal', 'article-magazine', 'article-newspaper', 'bill', 'book', 'broadcast', 'chapter', 'classic', 'collection', 'dataset', 'document', 'entry', 'entry-dictionary', 'entry-encyclopedia', 'event', 'figure', 'graphic', 'hearing', 'interview', 'legal_case', 'legislation', 'map', 'motion_picture', 'musical_score', 'pamphlet', 'patent', 'performance', 'periodical', 'personal_communication', 'post', 'post-weblog', 'regulation', 'review', 'review-book', 'software', 'song', 'speech', 'standard', 'treaty', 'webpage']
}

@@ -199,3 +190,3 @@ }

toTarget(sourceType, subType) {
const type = types.source[sourceType] || 'book';
const type = types.source[sourceType] || 'document';

@@ -202,0 +193,0 @@ if (subType) {

@@ -10,3 +10,5 @@ {

"inproceedings": "paper-conference",
"manual": "report",
"mastersthesis": "thesis",
"misc": "document",
"phdthesis": "thesis",

@@ -13,0 +15,0 @@ "proceedings": "book",

@@ -18,17 +18,4 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

import bibtex from './bibtex.js';
import { crossref } from './crossref.js';
function crossref(entry, registry) {
if (entry.crossref in registry) {
const parent = registry[entry.crossref].properties;
if (parent === entry) {
return entry;
}
return Object.assign({}, crossref(parent, registry), entry);
}
return entry;
}
function _parse(input, spec) {

@@ -48,3 +35,3 @@ const registry = {};

[LABEL]: label
}, crossref(properties, registry))));
}, crossref(type, properties, registry))));
}

@@ -51,0 +38,0 @@

@@ -220,2 +220,16 @@ import { util } from '@citation-js/core';

},
EVENT_TITLE: {
toTarget(title, addon) {
if (addon) {
title += ' (' + addon + ')';
}
return title;
},
toSource(title) {
return title.match(/^(.+)(?: \((.+)\))?$/).slice(1, 3);
}
},
HOW_PUBLISHED: {

@@ -277,2 +291,12 @@ toTarget(howPublished) {

},
PAGES: {
toTarget(pages) {
return pages.replace(/[–—]/, '-');
},
toSource(pages) {
return pages.replace('-', '--');
}
},
STANDARD_NUMBERS: {

@@ -279,0 +303,0 @@ toTarget(...args) {

@@ -64,2 +64,19 @@ "use strict";

}
}, {
source: 's2id',
target: 'custom',
convert: {
toTarget(S2ID) {
return {
S2ID
};
},
toSource({
S2ID
}) {
return [S2ID];
}
}
}];

@@ -165,3 +182,3 @@ const aliases = [{

type(type) {
return !type.startsWith('article');
return !type || !type.startsWith('article');
}

@@ -237,3 +254,3 @@

if (!typeKey) {
if (type === 'masterthesis') {
if (type === 'mastersthesis') {
typeKey = 'mathesis';

@@ -251,3 +268,3 @@ }

return [_biblatexTypes.default.source[type] || 'book', typeKey || subtype];
return [_biblatexTypes.default.source[type] || 'document', typeKey || subtype];
},

@@ -282,7 +299,18 @@

}, {
source: 'eventtitle',
target: 'event'
source: ['eventtitle', 'eventtitleaddon'],
target: 'event-title',
convert: _shared.Converters.EVENT_TITLE
}, {
source: ['eventtitle', 'eventtitleaddon'],
target: 'event',
convert: _shared.Converters.EVENT_TITLE,
when: {
source: false,
target: {
'event-title': false
}
}
}, {
source: _shared.LABEL,
target: ['id', 'citation-label', 'author', 'issued', 'year-suffix', 'title'],
target: ['id', 'citation-key', 'author', 'issued', 'year-suffix', 'title'],
convert: _shared.Converters.LABEL

@@ -308,3 +336,3 @@ }, {

type: ['article', 'article-journal', 'article-newspaper', 'article-magazine']
type: ['article', 'article-journal', 'article-newspaper', 'article-magazine', 'periodical']
}

@@ -324,3 +352,3 @@ }

type: ['article', 'article-journal', 'article-newspaper', 'article-magazine', 'paper-conference']
type: ['article', 'article-journal', 'article-newspaper', 'article-magazine', 'paper-conference', 'periodical']
}

@@ -365,2 +393,10 @@ }

}, {
source: 'eid',
target: 'number',
when: {
target: {
type: ['article-journal']
}
}
}, {
source: ['isan', 'ismn', 'isrn', 'iswc'],

@@ -410,14 +446,10 @@ target: 'number',

}, {
source: ['pages', 'eid'],
source: 'pages',
target: 'page',
convert: {
toTarget(pages, eid) {
return eid ? eid.replace(/^e?/i, 'e') : pages.replace(/[–—]/, '-');
},
toSource(page) {
return /^e/i.test(page) ? [page, page] : [page.replace('-', '--')];
when: {
source: {
bookpagination: [undefined, 'page']
}
}
},
convert: _shared.Converters.PAGES
}, {

@@ -427,2 +459,5 @@ source: 'pagetotal',

}, {
source: 'part',
target: 'part-number'
}, {
source: ['eprint', 'eprinttype'],

@@ -442,3 +477,3 @@ target: 'PMID',

target: {
type: ['article', 'article-journal', 'article-magazine', 'article-newspaper', 'bill', 'book', 'broadcast', 'chapter', 'dataset', 'entry', 'entry-dictionary', 'entry-encyclopedia', 'figure', 'graphic', 'interview', 'legal_case', 'legislation', 'manuscript', 'map', 'motion_picture', 'musical_score', 'pamphlet', 'paper-conference', 'patent', 'personal_communication', 'post', 'post-weblog', 'regulation', 'review', 'review-book', 'song', 'speech', 'treaty']
type: ['article', 'article-journal', 'article-magazine', 'article-newspaper', 'bill', 'book', 'broadcast', 'chapter', 'classic', 'collection', 'dataset', 'document', 'entry', 'entry-dictionary', 'entry-encyclopedia', 'event', 'figure', 'graphic', 'hearing', 'interview', 'legal_case', 'legislation', 'manuscript', 'map', 'motion_picture', 'musical_score', 'pamphlet', 'paper-conference', 'patent', 'performance', 'periodical', 'personal_communication', 'post', 'post-weblog', 'regulation', 'review', 'review-book', 'software', 'song', 'speech', 'standard', 'treaty']
}

@@ -514,2 +549,11 @@ }

}, {
source: 'shorttitle',
target: 'shortTitle',
when: {
source: false,
target: {
'title-short': false
}
}
}, {
source: ['title', 'subtitle', 'titleaddon'],

@@ -544,4 +588,8 @@ target: 'title',

target: 'number-of-volumes'
}, {
source: ['issuetitle', 'issuesubtitle', 'issuetitleaddon'],
target: 'volume-title',
convert: _shared.Converters.TITLE
}]);
exports.default = _default;

@@ -13,5 +13,7 @@ {

"dataset": "dataset",
"manual": "report",
"misc": "document",
"online": "webpage",
"patent": "patent",
"periodical": "article-journal",
"periodical": "periodical",
"proceedings": "book",

@@ -24,3 +26,3 @@ "mvproceedings": "book",

"report": "report",
"software": "book",
"software": "software",
"thesis": "thesis",

@@ -37,3 +39,5 @@ "unpublished": "manuscript",

"music": "musical_score",
"performance": "performance",
"review": "review",
"standard": "standard",
"video": "motion_picture",

@@ -56,8 +60,13 @@ "conference": "paper-conference",

"chapter": "inbook",
"classic": "unpublished",
"collection": "misc",
"dataset": "dataset",
"document": "misc",
"entry": "inreference",
"entry-dictionary": "inreference",
"entry-encyclopedia": "inreference",
"event": "misc",
"figure": "artwork",
"graphic": "artwork",
"hearing": "legal",
"interview": "audio",

@@ -71,10 +80,15 @@ "legal_case": "jurisdiction",

"patent": "patent",
"performance": "performance",
"periodical": "periodical",
"personal_communication": "letter",
"post": "online",
"post-weblog": "online",
"regulation": "legal",
"report": "report",
"review": "review",
"review-book": "review",
"software": "software",
"song": "music",
"speech": "audio",
"standard": "standard",
"thesis": "thesis",

@@ -81,0 +95,0 @@ "treaty": "legal",

@@ -89,3 +89,3 @@ "use strict";

source: _shared.LABEL,
target: ['id', 'citation-label', 'author', 'issued', 'year-suffix', 'title'],
target: ['id', 'citation-key', 'author', 'issued', 'year-suffix', 'title'],
convert: _shared.Converters.LABEL

@@ -104,3 +104,3 @@ }, {

type: ['article', 'article-journal', 'article-newspaper', 'article-magazine', 'paper-conference']
type: ['article', 'article-journal', 'article-newspaper', 'article-magazine', 'paper-conference', 'periodical']
}

@@ -129,12 +129,3 @@ }

target: 'page',
convert: {
toTarget(text) {
return text.replace(/[–—]/, '-');
},
toSource(text) {
return text.replace('-', '--');
}
}
convert: _shared.Converters.PAGES
}, {

@@ -146,3 +137,3 @@ source: 'publisher',

target: {
type: ['article', 'article-journal', 'article-magazine', 'article-newspaper', 'bill', 'book', 'broadcast', 'chapter', 'dataset', 'entry', 'entry-dictionary', 'entry-encyclopedia', 'figure', 'graphic', 'interview', 'legal_case', 'legislation', 'map', 'motion_picture', 'musical_score', 'pamphlet', 'patent', 'personal_communication', 'post', 'post-weblog', 'review', 'review-book', 'song', 'speech', 'treaty', 'webpage']
type: ['article', 'article-journal', 'article-magazine', 'article-newspaper', 'bill', 'book', 'broadcast', 'chapter', 'classic', 'collection', 'dataset', 'document', 'entry', 'entry-dictionary', 'entry-encyclopedia', 'event', 'figure', 'graphic', 'hearing', 'interview', 'legal_case', 'legislation', 'map', 'motion_picture', 'musical_score', 'pamphlet', 'patent', 'performance', 'periodical', 'personal_communication', 'post', 'post-weblog', 'regulation', 'review', 'review-book', 'software', 'song', 'speech', 'standard', 'treaty', 'webpage']
}

@@ -212,3 +203,3 @@ }

toTarget(sourceType, subType) {
const type = _bibtexTypes.default.source[sourceType] || 'book';
const type = _bibtexTypes.default.source[sourceType] || 'document';

@@ -215,0 +206,0 @@ if (subType) {

@@ -10,3 +10,5 @@ {

"inproceedings": "paper-conference",
"manual": "report",
"mastersthesis": "thesis",
"misc": "document",
"phdthesis": "thesis",

@@ -13,0 +15,0 @@ "proceedings": "book",

@@ -17,2 +17,4 @@ "use strict";

var _crossref = require("./crossref.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -34,16 +36,2 @@

function crossref(entry, registry) {
if (entry.crossref in registry) {
const parent = registry[entry.crossref].properties;
if (parent === entry) {
return entry;
}
return Object.assign({}, crossref(parent, registry), entry);
}
return entry;
}
function _parse(input, spec) {

@@ -63,3 +51,3 @@ const registry = {};

[_shared.LABEL]: label
}, crossref(properties, registry))));
}, (0, _crossref.crossref)(type, properties, registry))));
}

@@ -66,0 +54,0 @@

@@ -243,2 +243,16 @@ "use strict";

},
EVENT_TITLE: {
toTarget(title, addon) {
if (addon) {
title += ' (' + addon + ')';
}
return title;
},
toSource(title) {
return title.match(/^(.+)(?: \((.+)\))?$/).slice(1, 3);
}
},
HOW_PUBLISHED: {

@@ -300,2 +314,12 @@ toTarget(howPublished) {

},
PAGES: {
toTarget(pages) {
return pages.replace(/[–—]/, '-');
},
toSource(pages) {
return pages.replace('-', '--');
}
},
STANDARD_NUMBERS: {

@@ -302,0 +326,0 @@ toTarget(...args) {

The MIT License (MIT)
Copyright (c) 2015-2021 Lars Willighagen
Copyright (c) 2015-2022 Lars Willighagen

@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy

{
"name": "@citation-js/plugin-bibtex",
"version": "0.5.7",
"version": "0.6.0",
"description": "Plugin for BibTeX formats for Citation.js",

@@ -25,3 +25,3 @@ "keywords": [

"engines": {
"node": ">=10"
"node": ">=14.0.0"
},

@@ -41,8 +41,8 @@ "files": [

"devDependencies": {
"@citation-js/core": "^0.5.7"
"@citation-js/core": "^0.6.0"
},
"peerDependencies": {
"@citation-js/core": "^0.5.0-alpha.0"
"@citation-js/core": "^0.6.0"
},
"gitHead": "e253e74b1bb444a2b29fd14a4fd818617b7c55b3"
"gitHead": "204c12950afb9ab99bc2f2b8cc18643e53adbd47"
}

@@ -7,3 +7,3 @@ # @citation-js/plugin-bibtex

![License](https://img.shields.io/npm/l/@citation-js/plugin-bibtex.svg)
![Dependency status](https://david-dm.org/citation-js/citation-js/status.svg?path=packages%2Fplugin-bibtex)
![Dependency status](https://img.shields.io/librariesio/release/npm/@citation-js/plugin-bibtex)
---

@@ -10,0 +10,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc