|
1 | 1 | # Builtin functions |
2 | | -| Function Name | Description | Parameters | Example | |
3 | | -| --- | --- | --- | --- | |
| 2 | +|Function Name|Description|Parameters|Example| |
| 3 | +|---|---|---|---| |
4 | 4 | |`abs`|Returns the absolute value of the given number.|`number`|abs(number)| |
5 | 5 | |`add`|Adds two values.|`value1`, `value2`|add(value1, value2)| |
6 | 6 | |`and`|Performs a logical AND operation on two boolean values.|`value1`, `value2`|and(value1, value2)| |
|
15 | 15 | |`compact`|Removes None values from the given array.|`array`|compact(array)| |
16 | 16 | |`contains`| Checks if string contains a substring|`haystack`, `needle`|contains(haystack, needle)| |
17 | 17 | |`csv2table`| Convert csv string to markdown table|`csv`|csv2table(csv)| |
18 | | -|`debug`|Prints the debug information of the given value.|`value`|debug(value)| |
| 18 | +|`csv2table_row`| Convert csv string to markdown table row|`row`|csv2table_row(row)| |
| 19 | +|`debug`| Prints the debug information of the given value.|`msg`|debug(msg)| |
19 | 20 | |`del`|Deletes the element at the specified index in the array or string.|`array_or_string`, `index`|del(array_or_string, index)| |
20 | 21 | |`div`|Divides the first value by the second value.|`value1`, `value2`|div(value1, value2)| |
21 | 22 | |`downcase`|Converts the given string to lowercase.|`input`|downcase(input)| |
|
25 | 26 | |`explode`|Splits the given string into an array of characters.|`string`|explode(string)| |
26 | 27 | |`filter`| Filters the elements of an array based on a provided callback function.|`v`, `f`|filter(v, f)| |
27 | 28 | |`first`| Returns the first element of an array|`arr`|first(arr)| |
| 29 | +|`flatten`|Flattens a nested array into a single level array.|`array`|flatten(array)| |
28 | 30 | |`floor`|Rounds the given number down to the nearest integer.|`number`|floor(number)| |
29 | 31 | |`from_date`|Converts a date string to a timestamp.|`date_str`|from_date(date_str)| |
30 | 32 | |`get_md_list_level`|Returns the indent level of a markdown list node.|`list`|get_md_list_level(list)| |
|
101 | 103 | |`sort`|Sorts the elements of the given array.|`array`|sort(array)| |
102 | 104 | |`split`|Splits the given string by the specified separator.|`string`, `separator`|split(string, separator)| |
103 | 105 | |`starts_with`|Checks if the given string starts with the specified substring.|`string`, `substring`|starts_with(string, substring)| |
| 106 | +|`stderr`|Prints a message to standard error and returns the current value.|`message`|stderr(message)| |
104 | 107 | |`sub`|Subtracts the second value from the first value.|`value1`, `value2`|sub(value1, value2)| |
105 | 108 | |`test`| Tests if string matches a pattern|`s`, `pattern`|test(s, pattern)| |
106 | 109 | |`to_array`| Converts input to an array|`a`|to_array(a)| |
|
129 | 132 | |`trim`|Trims whitespace from both ends of the given string.|`input`|trim(input)| |
130 | 133 | |`trunc`|Truncates the given number to an integer by removing the fractional part.|`number`|trunc(number)| |
131 | 134 | |`tsv2table`| Convert tsv string to markdown table|`tsv`|tsv2table(tsv)| |
| 135 | +|`tsv2table_row`| Convert tsv string to markdown table row|`row`|tsv2table_row(row)| |
132 | 136 | |`type`|Returns the type of the given value.|`value`|type(value)| |
133 | 137 | |`uniq`|Removes duplicate elements from the given array.|`array`|uniq(array)| |
134 | 138 | |`upcase`|Converts the given string to uppercase.|`input`|upcase(input)| |
|
0 commit comments