html-express-js 4.1.0 → 4.2.0
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/package.json +4 -4
- package/src/index.d.ts +2 -1
- package/src/index.js +9 -1
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "html-express-js",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "An Express template engine to render HTML views using native JavaScript",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": ">=
|
|
8
|
+
"node": ">=22.19"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"src/index.js",
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"@types/mocha": "^10.0.6",
|
|
48
48
|
"@types/reload": "^3.2.3",
|
|
49
49
|
"@types/sinon": "^17.0.3",
|
|
50
|
-
"chai": "^
|
|
50
|
+
"chai": "^6.0.1",
|
|
51
51
|
"chokidar": "^4.0.1",
|
|
52
52
|
"express": "^5.1.0",
|
|
53
53
|
"husky": "^9.0.7",
|
|
54
54
|
"mocha": "^11.0.1",
|
|
55
55
|
"prettier": "^3.0.3",
|
|
56
|
-
"release-it": "
|
|
56
|
+
"release-it": "19.0.4",
|
|
57
57
|
"reload": "^3.2.0",
|
|
58
58
|
"sinon": "^21.0.0",
|
|
59
59
|
"typescript": "^5.4.3"
|
package/src/index.d.ts
CHANGED
|
@@ -31,7 +31,8 @@ export default function _default(opts?: HTMLExpressOptions): {
|
|
|
31
31
|
staticIndexHandler: HTMLExpressStaticIndexHandler;
|
|
32
32
|
engine: Parameters<import("express").Application["engine"]>[1];
|
|
33
33
|
};
|
|
34
|
-
export type
|
|
34
|
+
export type HTMLExpressStaticAsyncRequestHandler = (req: import("express").Request, res: import("express").Response, next: import("express").NextFunction) => Promise<void>;
|
|
35
|
+
export type HTMLExpressStaticIndexHandler = () => HTMLExpressStaticAsyncRequestHandler;
|
|
35
36
|
export type HTMLExpressBuildStateHandler = (req: import("express").Request) => Promise<Record<string, any>>;
|
|
36
37
|
export type HTMLExpressOptions = {
|
|
37
38
|
/**
|
package/src/index.js
CHANGED
|
@@ -127,9 +127,17 @@ export function html(strings, ...data) {
|
|
|
127
127
|
return rawHtml;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
+
/**
|
|
131
|
+
* @callback HTMLExpressStaticAsyncRequestHandler
|
|
132
|
+
* @param {import('express').Request} req
|
|
133
|
+
* @param {import('express').Response} res
|
|
134
|
+
* @param {import('express').NextFunction} next
|
|
135
|
+
* @returns {Promise<void>}
|
|
136
|
+
*/
|
|
137
|
+
|
|
130
138
|
/**
|
|
131
139
|
* @callback HTMLExpressStaticIndexHandler
|
|
132
|
-
* @returns {
|
|
140
|
+
* @returns {HTMLExpressStaticAsyncRequestHandler}
|
|
133
141
|
*/
|
|
134
142
|
|
|
135
143
|
/**
|