How to use the @citation-js/core/lib/plugin-common/input.parsers function in @citation-js/core

To help you get started, we’ve selected a few @citation-js/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github larsgw / citation.js / index.js View on Github external
prop: bibtex.parsers.prop.parse,
    text: bibtex.parsers.text.parse,
    type: bibtex.parsers.type.parse
  }))(require('@citation-js/plugin-bibtex/lib/input')),
  bibtxt: ((bibtxt) => ({
    text: bibtxt.parse,
    textEntry: bibtxt.textEntry
  }))(require('@citation-js/plugin-bibtex/lib/input/bibtxt')),
  doi: ((doi) => ({
    api: doi.parsers.api.parse,
    id: doi.parsers.id.parse,
    async: {
      api: doi.parsers.api.parseAsync
    }
  }))(require('@citation-js/plugin-doi')),
  json: require('@citation-js/core/lib/plugin-common/input').parsers.json.parse,
  wikidata: ((wikidata) => ({
    json: wikidata.parsers.entity.parse,
    list: wikidata.parsers.id.parse,
    prop: wikidata.parsers.prop.parse,
    type: wikidata.parsers.prop.parseType,
    async: {
      json: wikidata.parsers.entity.parseAsync,
      prop (...args) {
        return Promise.resolve(wikidata.parsers.prop.parse.apply(this, args))
      }
    }
  }))(require('@citation-js/plugin-wikidata'))
}, Cite.plugins.input)

Cite.get = Object.assign({
  dict: Cite.plugins.dict,