TagScript
Getting Started

Module: tagscript

Enumerations

Classes

Interfaces

Type Aliases

Awaitable

Ƭ Awaitable<T>: PromiseLike<T> | T

Represents a type that may or may not be a promise

Type parameters

NameDescription
TThe type of the value

Defined in

lib/Utils/Util.ts:6


TransformerFunction

Ƭ TransformerFunction: (tag: Lexer) => string

Type declaration

▸ (tag): string

Parameters
NameType
tagLexer
Returns

string

Defined in

lib/Transformer/Function.ts:4

Variables

escapeRegex

Const escapeRegex: RegExp (opens in a new tab)

Defined in

lib/Utils/Util.ts:9


splitRegex

Const splitRegex: RegExp (opens in a new tab)

Defined in

lib/Utils/Util.ts:8

Functions

asyncFilter

asyncFilter<T>(values, fn): Promise (opens in a new tab)<T[]>

Identical to Array.filter() (opens in a new tab) but works with async filter functions.

Type parameters

NameDescription
TThe type of the values

Parameters

NameTypeDescription
valuesT[]The array of values
fn(t: T) => Awaitable<boolean>The filter function

Returns

Promise (opens in a new tab)<T[]>

Defined in

lib/Utils/Util.ts:20


escapeContent

escapeContent(content): string

Escapes special tagscript syntax in a string.

Parameters

NameTypeDescription
contentstringThe content to escape

Returns

string

Defined in

lib/Utils/Util.ts:33


implicitBool

implicitBool(str): null | boolean

Checks if the given value is 'true' or 'false'. If it is, it returns the boolean value. Otherwise, it returns null

Parameters

NameTypeDescription
strstringThe string to check

Returns

null | boolean

Defined in

lib/Utils/Util.ts:42


parseIf

parseIf(str): boolean

Parses an if statement. Returns a value based on the conditions.

Parameters

NameTypeDescription
strstringThe string to parse

Returns

boolean

Defined in

lib/Utils/Util.ts:58


parseListIf

parseListIf(str): boolean[]

Parses multiple if statements from a string.

Parameters

NameTypeDescription
strstringThe string to parse

Returns

boolean[]

Defined in

lib/Utils/Util.ts:118


split

split(str, extended?): string[]

Split a string by |, but ignore escaped characters.

Parameters

NameTypeDefault valueDescription
strstringundefinedThe string to split
extendedbooleanfalseallow ~ or , as separators

Returns

string[]

Remarks

If extended if true, it will also split by ~ and ,

Defined in

lib/Utils/Util.ts:104