ha-nunjucks 1.3.0-beta.21 → 1.3.0-beta.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +4 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -11,9 +11,9 @@ for (const f in FILTERS) {
11
11
  }
12
12
  for (const f in HASS_FILTERS) {
13
13
  env.addFilter(f, function (...args) {
14
- const hass = JSON.parse(decodeURIComponent(new nunjucks.Template('{{ to_json(hass) }}').render(
14
+ const hass = JSON.parse(new nunjucks.Template('{{ hass | dump | safe }}').render(
15
15
  // @ts-ignore
16
- this.getVariables())));
16
+ this.getVariables()));
17
17
  return HASS_FILTERS[f](hass, ...args);
18
18
  });
19
19
  }
@@ -24,9 +24,9 @@ for (const t in TESTS) {
24
24
  }
25
25
  for (const t in HASS_TESTS) {
26
26
  env.addTest(t, function (...args) {
27
- const hass = JSON.parse(decodeURIComponent(new nunjucks.Template('{{ to_json(hass) }}').render(
27
+ const hass = JSON.parse(new nunjucks.Template('{{ hass | dump | safe }}').render(
28
28
  // @ts-ignore
29
- this.getVariables())));
29
+ this.getVariables()));
30
30
  return HASS_TESTS[t](hass, ...args);
31
31
  });
32
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ha-nunjucks",
3
- "version": "1.3.0-beta.21",
3
+ "version": "1.3.0-beta.22",
4
4
  "description": "Wrapper for nunjucks for use with Home Assistant frontend custom components to render templates",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",