Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

academia

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

academia - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

names.js

16

index.js

@@ -17,13 +17,13 @@ var academia;

acl.stringifyNames = stringifyNames;
var name = '[A-Z][^()\\s]+';
var name = '[A-Z][^()\\s]+(?: [IV]+)?';
var year = '[0-9]{4}(?:[-–—][0-9]{4})?[a-z]?';
var citeSources = [
// et al., duo, and single, with year in parens
(name + " et al. \\(" + year + "\\)"),
(name + " and " + name + " \\(" + year + "\\)"),
(name + " \\(" + year + "\\)"),
(name + "\\s+et\\s+al.\\s+\\(" + year + "\\)"),
(name + "\\s+(?:and|&)\\s+" + name + "\\s+\\(" + year + "\\)"),
(name + "\\s+\\(" + year + "\\)"),
// et al., duo, and single, with year not in parens (note the commas)
(name + " et al., " + year + "\\b"),
(name + " and " + name + ", " + year + "\\b"),
(name + ", " + year + "\\b"),
(name + "\\s+et\\s+al.,\\s+" + year + "\\b"),
(name + "\\s+(?:and|&)\\s+" + name + ",\\s+" + year + "\\b"),
(name + ",\\s+" + year + "\\b"),
];

@@ -111,3 +111,3 @@ acl.citeRegExp = new RegExp(citeSources.join('|'), 'g');

// TODO: fix the 'et al.' hack
return input.replace(/\s+et al\./, ', et al.').split(/,\s*and\s+|\s*and\s+|,\s*/);
return input.replace(/\s+et al\./, ', et al.').split(/,\s*(?:and|&)\s+|\s*(?:and|&)\s+|,\s*/);
}

@@ -114,0 +114,0 @@ names.splitNames = splitNames;

@@ -23,3 +23,3 @@ import types = require('./types');

// TODO: fix the 'et al.' hack
return input.replace(/\s+et al\./, ', et al.').split(/,\s*and\s+|\s*and\s+|,\s*/);
return input.replace(/\s+et al\./, ', et al.').split(/,\s*(?:and|&)\s+|\s*(?:and|&)\s+|,\s*/);
}

@@ -26,0 +26,0 @@

@@ -11,3 +11,3 @@ {

],
"version": "0.1.1",
"version": "0.1.2",
"homepage": "https://github.com/chbrown/academia",

@@ -14,0 +14,0 @@ "repository": "git://github.com/chbrown/academia.git",

@@ -14,3 +14,3 @@ import types = require('../types');

var name = '[A-Z][^()\\s]+';
var name = '[A-Z][^()\\s]+(?: [IV]+)?';
var year = '[0-9]{4}(?:[-–—][0-9]{4})?[a-z]?';

@@ -20,9 +20,9 @@

// et al., duo, and single, with year in parens
`${name} et al. \\(${year}\\)`,
`${name} and ${name} \\(${year}\\)`,
`${name} \\(${year}\\)`,
`${name}\\s+et\\s+al.\\s+\\(${year}\\)`,
`${name}\\s+(?:and|&)\\s+${name}\\s+\\(${year}\\)`,
`${name}\\s+\\(${year}\\)`,
// et al., duo, and single, with year not in parens (note the commas)
`${name} et al., ${year}\\b`,
`${name} and ${name}, ${year}\\b`,
`${name}, ${year}\\b`,
`${name}\\s+et\\s+al.,\\s+${year}\\b`,
`${name}\\s+(?:and|&)\\s+${name},\\s+${year}\\b`,
`${name},\\s+${year}\\b`,
];

@@ -29,0 +29,0 @@ export const citeRegExp = new RegExp(citeSources.join('|'), 'g');

@@ -108,1 +108,15 @@ // the original text from the paper (for debugging)

// console.log(dts_string);
/**
config will be an object like:
{
"styles": {
"acl": "styles/acl"
},
"names": "names",
"types": "types"
}
*/
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