All Versions
10
Latest Version
Avg Release Cycle
611 days
Latest Release
2623 days ago

Changelog History

  • v2.0.0 Changes

    February 16, 2017

    ๐Ÿ‘ Allow multiline parameters in defines (#221, @RionStick)

  • v2.0.0-beta.1 Changes

    July 26, 2020

    ๐Ÿ”„ Changes/additions:

    • ES6 code generated
    • types: https://github.com/olado/doT/blob/v2/doT.d.ts
    • varname option renamed to argName
    • ๐Ÿ‘Œ support templates without explicit context "it" - the list of properties should be passed as array to argName option, template function will expect an object and will destructure it into multiple arguments - so it is nearly zero-cost:

      const tmpl = doT.template("{{=foo}}{{=bar}}", {argName: ["foo", "bar"]})tmpl({foo: 1, bar: 2}) // "12"

    • ๐Ÿš€ partial options can be passed, global options object will not be available in the next release.

    • custom encoders:

      • syntax {{<encoder name>! it.foo}}, encoders passed to encoders option object ( is any valid JS identifier) as functions (or as code strings in selfContained: true mode).
      • HTML encoding with syntax {{! it.foo }} requires passing {encoders: {"": require("dot/encodeHTML")}} options
    • type safe interpolation (maybe % should be dropped...):

      • {{%n= it.foo}} - it.foo must be number (or exception will be thrown)
      • {{%s= it.foo}} - string
      • {{%b= it.foo}} - boolean
    • ๐Ÿ‘Œ support iterables for {{~iter:x}} and {{~iter:x:i}} syntaxes (now uses for-of loop).

    • syntax is no longer in options

    • ๐Ÿ”ง configurable delimiters:

      • e.g. {delimiters: {start: "<%", end: "%>"}} via options to change for one template
      • or setDelimiters({start: "<%", end: "%>"}) to change globally
    • reduces internal variables names usage, two configurable name prefixes are used, can be changed via options (internalPrefix: "_val", encodersPrefix: "_enc").

    • optional iterator index variable is now local (with let)

    โœ‚ Removed:

    • doT.process (possibly will be added if there is an interest)
    • ๐Ÿ’ป browser bundle (possibly will be added if there is a substantial interest)
    • dot-packer - can be added as a separate module to dot-template org
    • legacy doU engine
    • 0๏ธโƒฃ append: false option (only append: true now, that is faster and that was default anyway)
    • ๐Ÿ‘€ no HTML interpolation by default (see custom encoders above)
  • v2.0.0-beta.0 Changes

    February 16, 2017

    ๐Ÿ‘ Allow multiline parameters in defines (#221, @RionStick)

  • v1.1.3 Changes

    December 07, 2019

    โœ… Tests for doT.process
    Patch code injection via prototype pollution (#291)

  • v1.1.2

    May 22, 2017
  • v1.1.1

    November 06, 2016
  • v1.1.0 Changes

    February 16, 2017

    โž• Added tests

  • v1.0.3

    November 01, 2016
  • v1.0.1

    September 18, 2013
  • v0.2.0

    December 24, 2012