vintasend-pug 0.1.6 → 0.1.8
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.
|
@@ -9,7 +9,7 @@ class PugEmailTemplateRenderer {
|
|
|
9
9
|
constructor(options = {}) {
|
|
10
10
|
this.options = options;
|
|
11
11
|
}
|
|
12
|
-
render(notification, context) {
|
|
12
|
+
async render(notification, context) {
|
|
13
13
|
const bodyTemplate = pug_1.default.compileFile(notification.bodyTemplate, this.options);
|
|
14
14
|
if (!notification.subjectTemplate) {
|
|
15
15
|
throw new Error('Subject template is required');
|
|
@@ -17,8 +17,8 @@ class PugEmailTemplateRenderer {
|
|
|
17
17
|
const subjectTemplate = pug_1.default.compileFile(notification.subjectTemplate, this.options);
|
|
18
18
|
return new Promise((resolve) => {
|
|
19
19
|
resolve({
|
|
20
|
-
subject: subjectTemplate(context
|
|
21
|
-
body: bodyTemplate(context
|
|
20
|
+
subject: subjectTemplate(context),
|
|
21
|
+
body: bodyTemplate(context),
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
24
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vintasend-pug",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc",
|
|
8
|
-
"prepublishOnly": "npm run build"
|
|
8
|
+
"prepublishOnly": "npm run build",
|
|
9
|
+
"test": "jest",
|
|
10
|
+
"test:watch": "jest --watch",
|
|
11
|
+
"test:coverage": "jest --coverage"
|
|
9
12
|
},
|
|
10
13
|
"files": [
|
|
11
14
|
"dist"
|
|
@@ -14,10 +17,13 @@
|
|
|
14
17
|
"license": "MIT",
|
|
15
18
|
"dependencies": {
|
|
16
19
|
"pug": "^3.0.3",
|
|
17
|
-
"vintasend": "^0.1.
|
|
20
|
+
"vintasend": "^0.1.8"
|
|
18
21
|
},
|
|
19
22
|
"devDependencies": {
|
|
23
|
+
"@types/jest": "^29.5.14",
|
|
20
24
|
"@types/pug": "^2.0.10",
|
|
25
|
+
"jest": "^29.7.0",
|
|
26
|
+
"ts-jest": "^29.2.6",
|
|
21
27
|
"typescript": "^5.8.2"
|
|
22
28
|
}
|
|
23
29
|
}
|