Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
get: (ids, options = {}) => {
require('@citation-js/plugin-wikidata')
const languages = options.languages || []
if (languages[0]) {
plugins.config.get('@wikidata').langs = languages
}
return (Cite(ids) || { get: () => [] }).get().map(tidyCsl)
},
format: (items, format, options = {}) => {
if (format === 'ndjson') {
return items.map(item => JSON.stringify(item)).join('\n')
} else if (format === 'json') {
return JSON.stringify(items, null, 2)
}
const cite = new Cite(items)
if (format === 'bibtex' || format === 'bibtxt') {
require('@citation-js/plugin-bibtex')
} else {
require('@citation-js/plugin-csl')
options.format = format
if (format === 'text') {
options.prepend = item => `${item.id}: `
} else if (format !== 'html') {
throw new Error(`unknown citation format ${format}`)
}
format = 'bibliography'
}
function Cite (data, opts) {
if (!(this instanceof Cite)) {
return new Cite(data, opts)
}
var self = new core.Cite(data, opts)
this._options = self._options
this.log = self.log
this.data = self.data
}