Releases: MCDevKit/json-templating-engine
Releases · MCDevKit/json-templating-engine
1.4.0
Added:
- Implementation of add operator between objects (merges two objects, where in
a + b
,a
is the higher priority) and arrays (joins two arrays) - Templating mcfunction files (putting
#{expression}
anywhere in mcfunction will replace it with evaluated expression) --minify
option- Improved error reporting when loading scope
Functions added:
- sort
- range
- lastIndexOf
Fixed:
- Lambda scope stack
- Casting string to a number or a boolean
- Escaping backslashes at the end of the string
- Field and Reference grammar merged, so this expression works now
'stage_' + (stage == 3 ? 'full' : stage)
1.3.0
Added:
- Null coalescing operator (
value ?? 'return value when value is null'
) - Null-conditional operators (
object?.valueThatMightNotBeDefined
) - Instance functions (
array.count()
instead ofcount(array)
) - Ability to override module scope in templates
- Templating inside
$extend
field - Iteration data in
$copy
field - Current scope stack (in nested loops, you will be able to access data from outer loop)
--include
and--exclude
option (for excluding or including files based on glob pattern)--remove-src
flag (after compiling template files, will remove them)- Ability to use null values, when calling functions
- Ability to use template string as predicate value (e.g.
{"?predicate": "{{array}}"}
)
Functions added:
- bitshiftLeft
- bitshiftRight
- bitwiseAnd
- bitwiseNot
- bitwiseOr
- bitwiseXor
- chars
- encode
- getLatestBPFile
- getLatestRPFile
- indexOf
- listLatestBPFiles
- listLatestRPFiles
- load
- max
- min
- sublist
Fixed:
- Range with negative start
- Equations inside parentheses
- Order of field grammar
- Boolean literal value
- Copy iteration