@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 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
- req.locals[key] = await locals[key](req, res);
280
+ localsReq.locals[key] = await locals[key](localsReq, localsRes);
281
281
  } else {
282
- req.locals[key] = locals[key];
282
+ localsReq.locals[key] = locals[key];
283
283
  }
284
284
  }
285
285
  };
@@ -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
- req.locals[key] = await locals[key](req, res);
278
+ localsReq.locals[key] = await locals[key](localsReq, localsRes);
279
279
  } else {
280
- req.locals[key] = locals[key];
280
+ localsReq.locals[key] = locals[key];
281
281
  }
282
282
  }
283
283
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jaypie/express",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "author": "Finlayson Studio",
5
5
  "type": "module",
6
6
  "exports": {
@@ -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
- req.locals[key] = await locals[key](req, res);
131
+ localsReq.locals[key] = await locals[key](localsReq, localsRes);
132
132
  } else {
133
- req.locals[key] = locals[key];
133
+ localsReq.locals[key] = locals[key];
134
134
  }
135
135
  }
136
136
  };