Module: index

Table of contents

Classes

Interfaces

Functions

Functions

clearFormat

clearFormat<T>(v): T

Type parameters

NameType
Textends Identifier | Tag | Value | Entry | Node | Document

Parameters

NameType
vT

Returns

T

Defined in

src/clear-format.js:122


format

format(v): string

Parameters

NameType
vIdentifier | Tag | Value | Entry | Node | Document

Returns

string

Defined in

src/format.js:144


getLocation

getLocation(element): undefined | Location

Get location information of the given parsed element

If the element was not created by the parser, or if the parser option storeLocations was not set to true, the result will be undefined.

Parameters

NameType
elementIdentifier | Tag | Value | Entry | Node | Document

Returns

undefined | Location

Defined in

src/locations.js:27


parse

parse(text, options): Value

Parse the given text as a value.

The text should not contain anything other than the value, i.e. no leading or trailing whitespace, no comments, no tags.

Parameters

NameType
textstring | ArrayBuffer | DataView | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array
optionsObject
options.as"value"
options.storeLocations?boolean

Returns

Value

Defined in

src/parse.d.ts:21

parse(text, options): Identifier

Parse the given text as a identifier.

The text should not contain anything other than the identifier, i.e. no leading or trailing whitespace, no comments, no tags.

Parameters

NameType
textstring | ArrayBuffer | DataView | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array
optionsObject
options.as"identifier"
options.storeLocations?boolean

Returns

Identifier

Defined in

src/parse.d.ts:40

parse(text, options): Entry

Parse the given text as an entry.

The text can contain extra whitespace, tags, and comments (though no slashdash comments of entire nodes)

Parameters

NameType
textstring | ArrayBuffer | DataView | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array
optionsObject
options.as"entry"
options.storeLocations?boolean

Returns

Entry

Defined in

src/parse.d.ts:59

parse(text, options): Node

Parse the given text as a node.

The text can contain extra whitespace, tags, and comments.

Parameters

NameType
textstring | ArrayBuffer | DataView | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array
optionsObject
options.as"node"
options.storeLocations?boolean

Returns

Node

Defined in

src/parse.d.ts:77

parse(text, options?): Document

Parse the given text as a document.

The text can contain extra whitespace, tags, and comments.

Parameters

NameType
textstring | ArrayBuffer | DataView | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array
options?Object
options.as?"document"
options.storeLocations?boolean

Returns

Document

Defined in

src/parse.d.ts:95