micromustache
Advanced tools
Comparing version 6.0.1 to 6.1.0
@@ -8,3 +8,3 @@ # Change Log | ||
## Unrelease | ||
## Unreleased | ||
@@ -25,6 +25,7 @@ - Support [optional chaining syntax](https://github.com/tc39/proposal-optional-chaining) | ||
- A change in terminology to better reflect JavaScript terms: What Mustache and the previous version of the lib called `view` is not called `scope`. | ||
- Expose a CommonJS build for the browser limited to ECMAScript 5 features. | ||
BREAKING CHANGES: | ||
- **The biggest change is that if you used `compile()` in version 5, it returned a function but since version 6, it returns an object that _has_ a `render()` function** | ||
- The behaviour of the resolver function has changed: In v5 if the resolver threw an error we fell back to the standard `.get()` functionality but v6 just throws that error in an effort to make debugging easier. | ||
- The behaviour of the resolver function has changed: In v5 if the resolver threw an error we fell back to the standard `.get()` functionality but v6 just throws that error in an effort to make debugging easier. | ||
- We don't use default exports anymore so `const render = require('micromustache/render')` | ||
@@ -31,0 +32,0 @@ should be refactored to `const { render } = require('micromustache')` |
{ | ||
"name": "micromustache", | ||
"version": "6.0.1", | ||
"version": "6.1.0", | ||
"description": "A fast, minimal and secure template engine for JavaScript", | ||
@@ -41,3 +41,3 @@ "keywords": [ | ||
"tslint-config-prettier": "^1.18.0", | ||
"typedoc": "^0.14.2", | ||
"typedoc": "^0.15.0", | ||
"typescript": "^3.5.1" | ||
@@ -48,4 +48,5 @@ }, | ||
"build:amd": "tsc -p tsconfig-amd.json", | ||
"build:commonjs": "tsc -p tsconfig-commonjs.json", | ||
"build:node": "tsc -p tsconfig-node.json", | ||
"build": "npm run clean && npm run build:amd && npm run build:node", | ||
"build": "npm run clean && npm run build:amd && npm run build:node && npm run build:commonjs", | ||
"docs": "typedoc src/", | ||
@@ -52,0 +53,0 @@ "lint": "tslint -p .", |
@@ -30,3 +30,3 @@ [![Build Status](https://travis-ci.org/userpixel/micromustache.svg?branch=master)](https://travis-ci.org/userpixel/micromustache) | ||
If variable interpolation is all you need, *micromustache* is a [drop-in replacement](src/mustachejs.spec.js) for MustacheJS (see its differences with [Mustache.js](https://github.com/userpixel/micromustache/wiki/Differences-with-Mustache.js)) | ||
If variable interpolation is all you need, *micromustache* is a [drop-in replacement](src/mustachejs.spec.ts) for MustacheJS (see its differences with [Mustache.js](https://github.com/userpixel/micromustache/wiki/Differences-with-Mustache.js)) | ||
@@ -285,6 +285,6 @@ [Try it in your browser!](https://npm.runkit.com/micromustache) | ||
* `explicit?: boolean = false` When set to a truthy value, rendering literally puts a `'null'` or `'undefined'` for values that are `null` or `undefined`. By default it swallows those values to be compatible with Mustache. | ||
* `propsExist?: boolean = false` When set to a truthy value, we throw a `ReferenceError` for invalid varNames. Invalid varNames are the ones that do not exist in the scope. In that case the value for the varNames will be assumed an empty string. By default we throw a `ReferenceError` to be compatible with how JavaScript threats such invalid reference. | ||
* `propsExist?: boolean = false` When set to a truthy value, we throw a `ReferenceError` for invalid varNames. Invalid varNames are the ones that do not exist in the scope. By default, invalid varNames will be resolved to an empty string. | ||
If a value does not exist in the scope, two things can happen: | ||
- if `propsExist` is truthy, the value will be resolved to an empty string | ||
- if `propsExist` is falsy, a `ReferenceError` will be thrown | ||
- if `propsExist` is falsy (default), the value will be resolved to an empty string | ||
- if `propsExist` is truthy, a `ReferenceError` will be thrown | ||
* `validateVarNames?: boolean = false` When set to a truthy value, validates the variable names | ||
@@ -291,0 +291,0 @@ * `tags?: string[2] = ['{{', '}}']` The string symbols that mark the opening and closing of a variable name in the template. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2271294
91
4755