@jaypie/express 1.0.11 → 1.0.12
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/dist/module.cjs +3 -3
- package/dist/module.esm.js +3 -3
- package/package.json +1 -1
- package/src/expressHandler.js +3 -3
package/dist/module.cjs
CHANGED
|
@@ -271,15 +271,15 @@ const expressHandler = (
|
|
|
271
271
|
// Locals
|
|
272
272
|
const keys = Object.keys(locals);
|
|
273
273
|
if (keys.length > 0) {
|
|
274
|
-
const localsSetup = async () => {
|
|
274
|
+
const localsSetup = async (localsReq, localsRes) => {
|
|
275
275
|
for (let i = 0; i < keys.length; i += 1) {
|
|
276
276
|
const key = keys[i];
|
|
277
277
|
libLogger.trace(`[jaypie] Locals: ${key}`);
|
|
278
278
|
if (typeof locals[key] === "function") {
|
|
279
279
|
// eslint-disable-next-line no-await-in-loop
|
|
280
|
-
|
|
280
|
+
localsReq.locals[key] = await locals[key](localsReq, localsRes);
|
|
281
281
|
} else {
|
|
282
|
-
|
|
282
|
+
localsReq.locals[key] = locals[key];
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
};
|
package/dist/module.esm.js
CHANGED
|
@@ -269,15 +269,15 @@ const expressHandler = (
|
|
|
269
269
|
// Locals
|
|
270
270
|
const keys = Object.keys(locals);
|
|
271
271
|
if (keys.length > 0) {
|
|
272
|
-
const localsSetup = async () => {
|
|
272
|
+
const localsSetup = async (localsReq, localsRes) => {
|
|
273
273
|
for (let i = 0; i < keys.length; i += 1) {
|
|
274
274
|
const key = keys[i];
|
|
275
275
|
libLogger.trace(`[jaypie] Locals: ${key}`);
|
|
276
276
|
if (typeof locals[key] === "function") {
|
|
277
277
|
// eslint-disable-next-line no-await-in-loop
|
|
278
|
-
|
|
278
|
+
localsReq.locals[key] = await locals[key](localsReq, localsRes);
|
|
279
279
|
} else {
|
|
280
|
-
|
|
280
|
+
localsReq.locals[key] = locals[key];
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
283
|
};
|
package/package.json
CHANGED
package/src/expressHandler.js
CHANGED
|
@@ -122,15 +122,15 @@ const expressHandler = (
|
|
|
122
122
|
// Locals
|
|
123
123
|
const keys = Object.keys(locals);
|
|
124
124
|
if (keys.length > 0) {
|
|
125
|
-
const localsSetup = async () => {
|
|
125
|
+
const localsSetup = async (localsReq, localsRes) => {
|
|
126
126
|
for (let i = 0; i < keys.length; i += 1) {
|
|
127
127
|
const key = keys[i];
|
|
128
128
|
libLogger.trace(`[jaypie] Locals: ${key}`);
|
|
129
129
|
if (typeof locals[key] === "function") {
|
|
130
130
|
// eslint-disable-next-line no-await-in-loop
|
|
131
|
-
|
|
131
|
+
localsReq.locals[key] = await locals[key](localsReq, localsRes);
|
|
132
132
|
} else {
|
|
133
|
-
|
|
133
|
+
localsReq.locals[key] = locals[key];
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
};
|