Module: index
Table of contents
Classes
Interfaces
Functions
Functions
clearFormat
▸ clearFormat<T
>(v
): T
Type parameters
Parameters
Name | Type |
---|---|
v | T |
Returns
T
Defined in
format
▸ format(v
): string
Parameters
Returns
string
Defined in
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
Returns
undefined
| Location
Defined in
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
Name | Type |
---|---|
text | string | ArrayBuffer | DataView | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array |
options | Object |
options.as | "value" |
options.storeLocations? | boolean |
Returns
Defined in
▸ 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
Name | Type |
---|---|
text | string | ArrayBuffer | DataView | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array |
options | Object |
options.as | "identifier" |
options.storeLocations? | boolean |
Returns
Defined in
▸ 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
Name | Type |
---|---|
text | string | ArrayBuffer | DataView | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array |
options | Object |
options.as | "entry" |
options.storeLocations? | boolean |
Returns
Defined in
▸ parse(text
, options
): Node
Parse the given text as a node.
The text can contain extra whitespace, tags, and comments.
Parameters
Name | Type |
---|---|
text | string | ArrayBuffer | DataView | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array |
options | Object |
options.as | "node" |
options.storeLocations? | boolean |
Returns
Defined in
▸ parse(text
, options?
): Document
Parse the given text as a document.
The text can contain extra whitespace, tags, and comments.
Parameters
Name | Type |
---|---|
text | string | ArrayBuffer | DataView | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array |
options? | Object |
options.as? | "document" |
options.storeLocations? | boolean |