@measurequick/measurequick-report-generator 1.0.1 → 1.0.2
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.
- package/assets/{request.json → request.js} +1 -1
- package/index.js +6 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
|
|
2
2
|
import * as graphics from "./assets/graphics.js";
|
|
3
3
|
import * as templates from "./assets/templates.js";
|
|
4
|
-
import * as request from "./assets/request.
|
|
4
|
+
import * as request from "./assets/request.js";
|
|
5
5
|
|
|
6
6
|
var jsPDF = require("jspdf/dist/jspdf.node.min");
|
|
7
7
|
var doc = new jsPDF(templates.docOptions);
|
|
8
|
+
var reportData;
|
|
8
9
|
|
|
9
|
-
export function getReport(
|
|
10
|
+
export function getReport(data=null) {
|
|
10
11
|
try {
|
|
12
|
+
if (data == null) reportData = JSON.parse(JSON.stringify(request.body));
|
|
13
|
+
else reportData = JSON.parse(JSON.stringify(data));
|
|
14
|
+
|
|
11
15
|
printBoilerPlate(reportData.meta.reportTheme);
|
|
12
16
|
|
|
13
17
|
var profilePicture = reportData.meta.profilePicturePlacement == "header" ? reportData.photos.profilePicture : null;
|