express-hbs 2.4.1 → 2.4.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/.github/workflows/test.yml +1 -1
- package/lib/resolver.js +9 -4
- package/package.json +2 -3
package/lib/resolver.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var Promise = require('bluebird');
|
|
4
|
-
|
|
5
3
|
var generateId = require('./generate-id');
|
|
6
4
|
|
|
7
5
|
var ID_LENGTH = 8;
|
|
@@ -28,9 +26,16 @@ function resolve(cache, fn, context) {
|
|
|
28
26
|
return id;
|
|
29
27
|
}
|
|
30
28
|
|
|
29
|
+
// cache is an object where the keys are cache keys and values are promises. See above.
|
|
31
30
|
function done(cache, callback) {
|
|
32
|
-
Promise.
|
|
33
|
-
|
|
31
|
+
return Promise.all(Object.values(cache))
|
|
32
|
+
.then(function(values) {
|
|
33
|
+
var resolvedCache = {};
|
|
34
|
+
var keys = Object.keys(cache);
|
|
35
|
+
values.forEach(function(value, index) {
|
|
36
|
+
resolvedCache[keys[index]] = value;
|
|
37
|
+
});
|
|
38
|
+
callback(null, resolvedCache);
|
|
34
39
|
}).catch(function(error) {
|
|
35
40
|
callback(error);
|
|
36
41
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "express-hbs",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "Express handlebars template engine complete with multiple layouts, partials and blocks.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"express4",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"cookie-parser": "1.4.6",
|
|
33
|
-
"eslint": "8.
|
|
33
|
+
"eslint": "8.48.0",
|
|
34
34
|
"express": "4.18.2",
|
|
35
35
|
"i18n": "0.15.1",
|
|
36
36
|
"mocha": "10.2.0",
|
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
"supertest": "6.3.3"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"bluebird": "^3.5.3",
|
|
43
42
|
"handlebars": "^4.7.7",
|
|
44
43
|
"lodash": "^4.17.21",
|
|
45
44
|
"readdirp": "^3.6.0"
|