Module: tagscript
Enumerations
Classes
- BaseParser
- BreakParser
- Context
- DefineParser
- FiftyFiftyParser
- FunctionTransformer
- IfStatementParser
- IncludesParser
- IntegerTransformer
- Interpreter
- IntersectionStatementParser
- JSONVarParser
- Lexer
- LooseVarsParser
- Node
- OrdinalFormatParser
- RandomParser
- RangeParser
- ReplaceParser
- Response
- SafeObjectTransformer
- SliceParser
- StopParser
- StrictVarsParser
- StringFormatParser
- StringTransformer
- UnionStatementParser
- UrlDecodeParser
- UrlEncodeParser
Interfaces
Type Aliases
Awaitable
Ƭ Awaitable<T>: PromiseLike<T> | T
Represents a type that may or may not be a promise
Type parameters
| Name | Description |
|---|---|
T | The type of the value |
TransformerFunction
Ƭ TransformerFunction: (tag: Lexer) => string
Type declaration
▸ (tag): string
Parameters
| Name | Type |
|---|---|
tag | Lexer |
Returns
string
Variables
escapeRegex
• Const escapeRegex: RegExp (opens in a new tab)
splitRegex
• Const splitRegex: RegExp (opens in a new tab)
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
| Name | Description |
|---|---|
T | The type of the values |
Parameters
| Name | Type | Description |
|---|---|---|
values | T[] | The array of values |
fn | (t: T) => Awaitable<boolean> | The filter function |
Returns
Promise (opens in a new tab)<T[]>
escapeContent
▸ escapeContent(content): string
Escapes special tagscript syntax in a string.
Parameters
| Name | Type | Description |
|---|---|---|
content | string | The content to escape |
Returns
string
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
| Name | Type | Description |
|---|---|---|
str | string | The string to check |
Returns
null | boolean
parseIf
▸ parseIf(str): boolean
Parses an if statement. Returns a value based on the conditions.
Parameters
| Name | Type | Description |
|---|---|---|
str | string | The string to parse |
Returns
boolean
parseListIf
▸ parseListIf(str): boolean[]
Parses multiple if statements from a string.
Parameters
| Name | Type | Description |
|---|---|---|
str | string | The string to parse |
Returns
boolean[]
split
▸ split(str, extended?): string[]
Split a string by |, but ignore escaped characters.
Remarks
If extended if true, it will also split by ~ and ,
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
str | string | undefined | The string to split |
extended | boolean | false | allow ~ or , as separators |
Returns
string[]