Namespace: util

@citation-js/core.util

Classes

Grammar
Register
TokenStack
Translator

Methods

(protected, static) deepCopy(obj, seenopt) → {Object}

Duplicate objects to prevent Cite changing values outside of own scope

Parameters:
Name Type Attributes Description
obj Object

Input object

seen Set <optional>
Source:
Throws:
TypeError
Returns:

Duplicated object

Type
Object

(static) downgradeCsl(item) → {Object}

Downgrade CSL item from 1.0.2 to 1.0.1

Parameters:
Name Type Description
item Object

Input object

Source:
Returns:

downgraded item

Type
Object

(protected, static) fetchFile(url, optsopt) → {String}

Fetch file

Parameters:
Name Type Attributes Description
url String

The input url

opts module:@citation-js/core.util.fetchFile~options <optional>

Request options

Source:
Returns:

The fetched string

Type
String

(protected, static) fetchFileAsync(url, optsopt) → {Promise.<String>}

Fetch file (async)

Parameters:
Name Type Attributes Description
url String

The input url

opts module:@citation-js/core.util.fetchFile~options <optional>

Request options

Source:
Returns:

The fetched string

Type
Promise.<String>

(protected, static) fetchId(list, prefix) → {String}

Generate ID

Parameters:
Name Type Description
list Array.<String>

old ID list

prefix String

ID prefix

Source:
Returns:

CSL ID

Type
String

(protected, static) setUserAgent(url, optsopt)

Fetch file (async)

Parameters:
Name Type Attributes Description
url String

The input url

opts module:@citation-js/core.util.fetchFile~options <optional>

Request options

Source:

(static) upgradeCsl(item) → {Object}

Upgrade CSL item from 1.0.1 to 1.0.2

Parameters:
Name Type Description
item Object

Input object

Source:
Returns:

upgraded item

Type
Object