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.5 to 0.1.6

bin/academia

7

academia.d.ts

@@ -13,6 +13,6 @@ declare module "academia" {

/**
Given a list of strings representing individual references in a bibliography,
parse each one into a Reference structure.
Given a string representing an individual reference in a bibliography, parse
it into a Reference structure.
*/
function parseReferences(references: string[]): types.Reference[];
function parseReference(reference: string): types.Reference;
/**

@@ -147,4 +147,5 @@ In-place modifies `cites` by setting the `reference` value of each one where

references?: Reference[];
cites?: Cite[];
}
}
}

@@ -56,17 +56,15 @@ /// <reference path="./type_declarations/index.d.ts" />

/**
Given a list of strings representing individual references in a bibliography,
parse each one into a Reference structure.
Given a string representing an individual reference in a bibliography, parse
it into a Reference structure.
*/
function parseReferences(references) {
return references.map(function (reference) {
var match = reference.match(acl.referenceRegExp);
var authors = match ? names.parseNames(match[1]) : [];
return {
authors: authors,
year: match ? match[2] : undefined,
title: match ? match[3] : undefined,
};
});
function parseReference(reference) {
var match = reference.match(acl.referenceRegExp);
var authors = match ? names.parseNames(match[1]) : [];
return {
authors: authors,
year: match ? match[2] : undefined,
title: match ? match[3] : undefined,
};
}
acl.parseReferences = parseReferences;
acl.parseReference = parseReference;
/**

@@ -73,0 +71,0 @@ In-place modifies `cites` by setting the `reference` value of each one where

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

],
"version": "0.1.5",
"version": "0.1.6",
"homepage": "https://github.com/chbrown/academia",

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

@@ -62,2 +62,3 @@ # academia

references?: Reference[],
cites?: Cite[],
}

@@ -64,0 +65,0 @@

@@ -50,17 +50,15 @@ var types = require('../types');

/**
Given a list of strings representing individual references in a bibliography,
parse each one into a Reference structure.
Given a string representing an individual reference in a bibliography, parse
it into a Reference structure.
*/
function parseReferences(references) {
return references.map(function (reference) {
var match = reference.match(exports.referenceRegExp);
var authors = match ? names.parseNames(match[1]) : [];
return {
authors: authors,
year: match ? match[2] : undefined,
title: match ? match[3] : undefined,
};
});
function parseReference(reference) {
var match = reference.match(exports.referenceRegExp);
var authors = match ? names.parseNames(match[1]) : [];
return {
authors: authors,
year: match ? match[2] : undefined,
title: match ? match[3] : undefined,
};
}
exports.parseReferences = parseReferences;
exports.parseReference = parseReference;
/**

@@ -67,0 +65,0 @@ In-place modifies `cites` by setting the `reference` value of each one where

@@ -55,15 +55,13 @@ import types = require('../types');

/**
Given a list of strings representing individual references in a bibliography,
parse each one into a Reference structure.
Given a string representing an individual reference in a bibliography, parse
it into a Reference structure.
*/
export function parseReferences(references: string[]): types.Reference[] {
return references.map(reference => {
var match = reference.match(referenceRegExp);
var authors = match ? names.parseNames(match[1]) : [];
return {
authors: authors,
year: match ? match[2] : undefined,
title: match ? match[3] : undefined,
};
});
export function parseReference(reference: string): types.Reference {
var match = reference.match(referenceRegExp);
var authors = match ? names.parseNames(match[1]) : [];
return {
authors: authors,
year: match ? match[2] : undefined,
title: match ? match[3] : undefined,
};
}

@@ -70,0 +68,0 @@

@@ -75,2 +75,3 @@ /**

references?: Reference[];
cites?: Cite[];
}
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