Namespace: input

@citation-js/core.plugins.input

Namespaces

util

Methods

(static) add(format, parsers)

See the relevant tutorial: Input Plugins

Parameters:
Name Type Description
format module:@citation-js/core.plugins.input~format

input format name

parsers module:@citation-js/core.plugins.input~parsers

parsers

Source:
Tutorials:

(protected, static) addDataParser(format, parser, optionsopt)

Parameters:
Name Type Attributes Default Description
format module:@citation-js/core.plugins.input~format
parser module:@citation-js/core.plugins.input~parse | module:@citation-js/core.plugins.input~parseAsync
options Object <optional>
{}
Properties
Name Type Attributes Default Description
async Boolean <optional>
false
Source:

(static) addTypeParser(format, typeParser)

Parameters:
Name Type Description
format module:@citation-js/core.plugins.input~format
typeParser module:@citation-js/core.plugins.input.util.TypeParser
Source:

(protected, static) chain(input, optionsopt) → {Array.<module:@citation-js/core~CSL>}

Parse input until success.

Parameters:
Name Type Attributes Description
input module:@citation-js/core~InputData

input data

options module:@citation-js/core~InputOptions <optional>

options

Source:
Returns:

The parsed input

Type
Array.<module:@citation-js/core~CSL>

(protected, static) chainAsync(input, optionsopt) → {Promise.<Array.<module:@citation-js/core~CSL>>}

Parse input until success. (async)

Parameters:
Name Type Attributes Description
input module:@citation-js/core~InputData

input data

options module:@citation-js/core~InputOptions <optional>

options

Source:
Returns:

The parsed input

Type
Promise.<Array.<module:@citation-js/core~CSL>>

Parse input once.

Parameters:
Name Type Description
input module:@citation-js/core~InputData

input data

Source:
Returns:

The parsed input

Type
module:@citation-js/core~InputData

(protected, static) chainLinkAsync(input) → {Promise.<module:@citation-js/core~InputData>}

Parse input once. (async)

Parameters:
Name Type Description
input module:@citation-js/core~InputData

The input data

Source:
Returns:

The parsed input

Type
Promise.<module:@citation-js/core~InputData>

(static) data(input, type) → {*|Null}

Parameters:
Name Type Description
input module:@citation-js/core~InputData

input data

type module:@citation-js/core.plugins.input~format

input type

Source:
Returns:
  • parsed data

    Type
    *
  • if no parser available

    Type
    Null

(static) dataAsync(input, type) → {Promise|Promise.<Null>}

Parameters:
Name Type Description
input module:@citation-js/core~InputData

input data

type module:@citation-js/core.plugins.input~format

input type

Source:
Returns:
  • parsed data

    Type
    Promise
  • if no parser available

    Type
    Promise.<Null>

(static) get(format) → {Object}

Parameters:
Name Type Description
format module:@citation-js/core.plugins.input~format

input format name

Source:
Returns:

index

Type
Object

(static) has(format) → {Boolean}

Parameters:
Name Type Description
format module:@citation-js/core.plugins.input~format

input format name

Source:
Returns:

input format is registered

Type
Boolean

(static) hasDataParser(type, asyncopt) → {Boolean}

Parameters:
Name Type Attributes Default Description
type module:@citation-js/core.plugins.input~format
async Boolean <optional>
false

check only for async, or only sync

Source:
Returns:

parser exists

Type
Boolean

(static) hasTypeParser(type) → {Boolean}

Parameters:
Name Type Description
type module:@citation-js/core.plugins.input~format
Source:
Returns:

type parser is registered

Type
Boolean

(static) list() → {Array.<module:@citation-js/core.plugins.input~format>}

Source:
Returns:

input format is registered

Type
Array.<module:@citation-js/core.plugins.input~format>

(static) listDataParser(asyncopt)

Parameters:
Name Type Attributes Default Description
async Boolean <optional>
false
Source:

(static) listTypeParser() → {Array.<module:@citation-js/core.plugins.input~format>}

Source:
Returns:

list of registered type parsers

Type
Array.<module:@citation-js/core.plugins.input~format>

(static) remove(format)

Parameters:
Name Type Description
format module:@citation-js/core.plugins.input~format

input format name

Source:

(static) removeDataParser(type, asyncopt)

Parameters:
Name Type Attributes Default Description
type module:@citation-js/core.plugins.input~format
async Boolean <optional>
false
Source:

(static) removeTypeParser(type)

Parameters:
Name Type Description
type module:@citation-js/core.plugins.input~format
Source:

(static) treeTypeParser() → {Object}

Source:
Returns:

tree structure

Type
Object

(static) type(input) → {module:@citation-js/core.plugins.input~format}

Parameters:
Name Type Description
input module:@citation-js/core~InputData
Source:
Returns:

type

Type
module:@citation-js/core.plugins.input~format

(static) typeMatcher() → {RegExp}

Validate and parse the format name

Source:
Returns:
Type
RegExp

Type Definitions

(async) asyncDataParser(input)

Parameters:
Name Type Description
input InputData
Source:
Returns:

parsed data

dataParser(input)

Parameters:
Name Type Description
input InputData
Source:
Returns:

parsed data

dataType

Type:
  • String
Source:

elementConstraint

Type:
Source:

format

Type:
  • String
Source:

parsers

Type:
  • Object
Properties:
Name Type Description
parse module:@citation-js/core.plugins.input~dataParser
parseAsync module:@citation-js/core.plugins.input~asyncDataParser
parseType module:@citation-js/core.plugins.input~typeParser
Source:

predicate(input) → {Boolean}

Parameters:
Name Type Description
input InputData
Source:
Returns:

pass

Type
Boolean

propertyConstraint

Type:
  • Object
Properties:
Name Type Attributes Default Description
props String | Array.<String> <optional>
[]
match String <optional>
'every'
value module:@citation-js/core.plugins.input~valuePredicate <optional>
Source:

tokenList

Type:
  • Object
Properties:
Name Type Attributes Default Description
token RegExp

token pattern

split RegExp <optional>
/\s+/

token delimiter

every Boolean <optional>
true

match every token, or only some

trim Boolean <optional>
true

trim input whitespace before testing

Source:

typeParser

Type:
  • Object
Properties:
Name Type Description
dataType module:@citation-js/core.plugins.input~dataType
predicate module:@citation-js/core.plugins.input~predicate | RegExp
tokenList module:@citation-js/core.plugins.input~tokenList | RegExp
propertyConstraint module:@citation-js/core.plugins.input~propertyConstraint | Array.<module:@citation-js/core.plugins.input~propertyConstraint>
elementConstraint module:@citation-js/core.plugins.input~elementConstraint | Array.<module:@citation-js/core.plugins.input~elementConstraint>
extends module:@citation-js/core.plugins.input~format
Source:

valuePredicate(value) → {Boolean}

Parameters:
Name Type Description
value
Source:
Returns:

pass

Type
Boolean