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.7.11 to 0.7.12

1

lib-mjs/config.js

@@ -17,2 +17,3 @@ import biblatex from './mapping/biblatexTypes.json';

useIdAsLabel: false,
checkLabel: true,
asciiOnly: true

@@ -19,0 +20,0 @@ },

31

lib-mjs/mapping/shared.js

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

const unicode = /[^\u0020-\u007F]+/g;
function isLabelSafe(text) {
return !config.format.checkLabel || !text.match(unsafeChars);
}
function formatLabelFromId(id) {
if (id === null) {
return 'null';
} else if (id === undefined) {
return 'undefined';
} else if (config.format.checkLabel) {
return id.toString().replace(unsafeChars, '');
} else {
return id.toString();
}
}
function firstWord(text) {

@@ -231,17 +245,8 @@ if (!text) {

toSource(id, label, author, issued, suffix, title) {
let safeId;
if (id === null) {
safeId = 'null';
} else if (id === undefined) {
safeId = 'undefined';
} else {
safeId = id.toString().replace(unsafeChars, '');
}
if (config.format.useIdAsLabel) {
return safeId;
}
if (label && !unsafeChars.test(label)) {
if (label && isLabelSafe(label)) {
return label;
} else if (config.format.useIdAsLabel) {
return formatLabelFromId(id);
} else {
return formatLabel(author, issued, suffix, title) || safeId;
return formatLabel(author, issued, suffix, title) || formatLabelFromId(id);
}

@@ -248,0 +253,0 @@ }

@@ -26,2 +26,3 @@ "use strict";

useIdAsLabel: false,
checkLabel: true,
asciiOnly: true

@@ -28,0 +29,0 @@ },

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

const unicode = /[^\u0020-\u007F]+/g;
function isLabelSafe(text) {
return !_config.default.format.checkLabel || !text.match(unsafeChars);
}
function formatLabelFromId(id) {
if (id === null) {
return 'null';
} else if (id === undefined) {
return 'undefined';
} else if (_config.default.format.checkLabel) {
return id.toString().replace(unsafeChars, '');
} else {
return id.toString();
}
}
function firstWord(text) {

@@ -241,17 +255,8 @@ if (!text) {

toSource(id, label, author, issued, suffix, title) {
let safeId;
if (id === null) {
safeId = 'null';
} else if (id === undefined) {
safeId = 'undefined';
} else {
safeId = id.toString().replace(unsafeChars, '');
}
if (_config.default.format.useIdAsLabel) {
return safeId;
}
if (label && !unsafeChars.test(label)) {
if (label && isLabelSafe(label)) {
return label;
} else if (_config.default.format.useIdAsLabel) {
return formatLabelFromId(id);
} else {
return formatLabel(author, issued, suffix, title) || safeId;
return formatLabel(author, issued, suffix, title) || formatLabelFromId(id);
}

@@ -258,0 +263,0 @@ }

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

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

},
"gitHead": "a92f6b3c20b9342feb0303a017b806b312d66486"
"gitHead": "1fe938dcd9986c52353c2f971f677e7d6f93839d"
}

@@ -61,2 +61,4 @@ # @citation-js/plugin-bibtex

| `config.format.useIdAsLabel` | `true`, [`false`] | Use the entry ID as the label instead of generating one. |
| `config.format.checkLabel` | [`true`], `false` | Remove unsafe characters from the provided label (or ID). |
| `config.format.asciiOnly` | [`true`], `false` | Escape or remove non-ASCII characters. |

@@ -63,0 +65,0 @@ ### Type mappings

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