Skip to content

v1.0.12

Latest
Compare
Choose a tag to compare
@jucardi jucardi released this 15 Feb 08:17
· 1 commit to main since this release

v1.0.12

New Helpers:

  • includeAsString: Similar to include, allows to register a template, but reads the template contents from a string instead of a file. E.g: {{ includeAsString “templateName” .var_with_contents }}
  • invoke: Similar to {{ template [name] [data] }}, invokes a template by a given name with a data object. The difference with template is that 'invoke can be used with a string variable as the name instead of a hardcoded string.
  • parse: Attempts to parse the provided template contents using the provided data object and returns the parsed value. Usage {{ parse [obj] [template contents] }}.
  • parseXpath: Attempts to parse a value inside a data object as a template and returns the parsed value using the same entry object to parse the template. Usage {{ parse [obj] [xpath to value with template] }}
  • in: Indicates whether a value is contained in an array. Usage: {{ in [array] [value] }}

Minor Fixes:

  • The helper yaml now properly allows an optional argument to indicate the indentation of the resulting YAML. Usage {{ yaml [obj] [int] }} where the int number indicates the amount of spaces for indentation.
  • Map functions now allow XPATH to be provided with or without a . as a prefix