@legalplace/prerenderx 2.2.5 → 2.2.6

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.
@@ -30,6 +30,8 @@ var Prerender = (function () {
30
30
  Prerender.prototype.generateDocumentNamesHash = function () {
31
31
  var _this = this;
32
32
  Object.keys(this.model.documents).forEach(function (documentName) {
33
+ var _a, _b;
34
+ var documentParams = _this.model.documents[documentName].params;
33
35
  var conditionObject = _this.references.conditions.documents[documentName];
34
36
  var condition = conditionObject === undefined ? true : _this.conditions.executeCondition(conditionObject, 0, 0, 'documents');
35
37
  if (condition === true) {
@@ -39,8 +41,8 @@ var Prerender = (function () {
39
41
  .digest('hex');
40
42
  _this.documentsIndex[hash] = {
41
43
  name: documentName,
42
- pdf: true,
43
- docx: true
44
+ pdf: ((_a = documentParams === null || documentParams === void 0 ? void 0 : documentParams.formats) === null || _a === void 0 ? void 0 : _a.pdf) === undefined ? true : documentParams.formats.pdf,
45
+ docx: ((_b = documentParams === null || documentParams === void 0 ? void 0 : documentParams.formats) === null || _b === void 0 ? void 0 : _b.docx) === undefined ? true : documentParams.formats.docx
44
46
  };
45
47
  }
46
48
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legalplace/prerenderx",
3
- "version": "2.2.5",
3
+ "version": "2.2.6",
4
4
  "description": "PrerenderX",
5
5
  "main": "dist/index.js",
6
6
  "repository": "https://git.legalplace.eu/legalplace/prerenderx",
@@ -63,6 +63,7 @@ class Prerender {
63
63
 
64
64
  private generateDocumentNamesHash() {
65
65
  Object.keys(this.model.documents).forEach(documentName => {
66
+ const documentParams = this.model.documents[documentName].params
66
67
  const conditionObject = this.references.conditions.documents[documentName]
67
68
  const condition = conditionObject === undefined ? true : this.conditions.executeCondition(conditionObject, 0, 0, 'documents')
68
69
 
@@ -76,8 +77,8 @@ class Prerender {
76
77
  // Referencing in index
77
78
  this.documentsIndex[hash] = {
78
79
  name: documentName,
79
- pdf: true,
80
- docx: true
80
+ pdf: documentParams?.formats?.pdf === undefined ? true : documentParams.formats.pdf,
81
+ docx: documentParams?.formats?.docx === undefined ? true : documentParams.formats.docx
81
82
  }
82
83
  }
83
84
  })