citation-js-utils
Advanced tools
Comparing version 0.0.11 to 0.0.12
@@ -59,3 +59,6 @@ "use strict"; | ||
const data = cite.set(c).data[0]; | ||
const authors = data.author; | ||
let authors = data.author; | ||
if (!authors || authors.length === 0) { | ||
authors = data.editor; | ||
} | ||
const year = (_c = (_b = (_a = data.issued) === null || _a === void 0 ? void 0 : _a['date-parts']) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c[0]; | ||
@@ -122,2 +125,1 @@ const yearPart = kind === InlineCite.t ? ` (${year})` : `, ${year}`; | ||
exports.getCitations = getCitations; | ||
//# sourceMappingURL=index.js.map |
@@ -52,3 +52,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
const data = cite.set(c).data[0]; | ||
const authors = data.author; | ||
let authors = data.author; | ||
if (!authors || authors.length === 0) { | ||
authors = data.editor; | ||
} | ||
const year = (_c = (_b = (_a = data.issued) === null || _a === void 0 ? void 0 : _a['date-parts']) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c[0]; | ||
@@ -113,2 +116,1 @@ const yearPart = kind === InlineCite.t ? ` (${year})` : `, ${year}`; | ||
} | ||
//# sourceMappingURL=index.js.map |
@@ -38,1 +38,2 @@ import Cite from 'citation-js'; | ||
export declare function getCitations(bibtex: string): Promise<CitationRenderer>; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "citation-js-utils", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "Utilities for citation-js.", | ||
@@ -28,5 +28,4 @@ "main": "dist/cjs/index.js", | ||
"build:cjs": "tsc --project ./src/tsconfig.json --module commonjs --outDir dist/cjs", | ||
"declarations": "tsc --project ./src/tsconfig.json --declaration --emitDeclarationOnly --outDir dist/types", | ||
"build": "npm-run-all -l clean -p build:cjs build:esm declarations", | ||
"prepublishOnly": "npm run build" | ||
"declarations": "tsc --project ./src/tsconfig.json --declaration --emitDeclarationOnly --declarationMap --outDir dist/types", | ||
"build": "npm-run-all -l clean -p build:cjs build:esm declarations" | ||
}, | ||
@@ -56,6 +55,5 @@ "repository": { | ||
"@types/jest": "^28.1.6", | ||
"@types/react": "^18.0.15", | ||
"@types/sanitize-html": "^2.6.2", | ||
"eslint": "^8.21.0", | ||
"eslint-config-curvenote": "*", | ||
"eslint-config-curvenote": "latest", | ||
"jest": "^28.1.3", | ||
@@ -62,0 +60,0 @@ "npm-run-all": "^4.1.5", |
@@ -54,3 +54,6 @@ import type { CitationFormatOptions } from 'citation-js'; | ||
const data = cite.set(c).data[0]; | ||
const authors = data.author; | ||
let authors = data.author; | ||
if (!authors || authors.length === 0) { | ||
authors = data.editor; | ||
} | ||
const year = data.issued?.['date-parts']?.[0]?.[0]; | ||
@@ -57,0 +60,0 @@ const yearPart = kind === InlineCite.t ? ` (${year})` : `, ${year}`; |
10
397
17252
8