@lowdefy/nunjucks 4.0.0-alpha.1 → 4.0.0-alpha.12

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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -18,8 +18,7 @@ import dateFilter from './dateFilter.js';
18
18
  // dateFilter.setDefaultFormat('YYYY-MM-DD');
19
19
  export const nunjucksEnv = new nunjucks.Environment();
20
20
  nunjucksEnv.addFilter('date', dateFilter);
21
- const nunjucksTemplates = {
22
- };
21
+ const nunjucksTemplates = {};
23
22
  // slow
24
23
  export const nunjucksString = (templateString, value)=>{
25
24
  if (type.isPrimitive(value)) {
@@ -31,8 +30,7 @@ export const nunjucksString = (templateString, value)=>{
31
30
  };
32
31
  export const validNunjucksString = (templateString, returnError = false)=>{
33
32
  try {
34
- nunjucksString(templateString, {
35
- });
33
+ nunjucksString(templateString, {});
36
34
  return true;
37
35
  } catch (e) {
38
36
  if (returnError) {
@@ -55,8 +53,7 @@ export const nunjucksFunction = (templateString)=>{
55
53
  if (type.isString(templateString)) {
56
54
  const template = nunjucks.compile(templateString, nunjucksEnv);
57
55
  // execute once to throw catch template errors
58
- template.render({
59
- });
56
+ template.render({});
60
57
  nunjucksTemplates[templateString] = (value)=>{
61
58
  if (type.isPrimitive(value)) {
62
59
  return template.render({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/nunjucks",
3
- "version": "4.0.0-alpha.1",
3
+ "version": "4.0.0-alpha.12",
4
4
  "licence": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -40,18 +40,18 @@
40
40
  "test": "jest --coverage"
41
41
  },
42
42
  "dependencies": {
43
- "@lowdefy/helpers": "4.0.0-alpha.1",
44
- "moment": "2.29.1",
43
+ "@lowdefy/helpers": "4.0.0-alpha.12",
44
+ "moment": "2.29.3",
45
45
  "nunjucks": "3.2.3"
46
46
  },
47
47
  "devDependencies": {
48
- "@swc/cli": "0.1.52",
49
- "@swc/core": "1.2.112",
50
- "@swc/jest": "0.2.9",
51
- "jest": "27.3.1"
48
+ "@swc/cli": "0.1.55",
49
+ "@swc/core": "1.2.135",
50
+ "@swc/jest": "0.2.17",
51
+ "jest": "27.5.1"
52
52
  },
53
53
  "publishConfig": {
54
54
  "access": "public"
55
55
  },
56
- "gitHead": "c97a8fa6b5a641e7d50df09f5601a9c586eeb65a"
56
+ "gitHead": "41b6138a81bee7da362dad06345bc9f87b2c2133"
57
57
  }