@factorypure/logger 1.0.4 → 1.0.5

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.
Files changed (2) hide show
  1. package/dist/index.js +4 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -146,10 +146,12 @@ export const attachRequestId = (asyncLocalStorage, user) => {
146
146
  return (req, _res, next) => {
147
147
  const availableCharacters = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0987654321";
148
148
  let id = `userId-${user.id}:userEmail-${user.email}:`;
149
- while (id.length < 10) {
150
- id +=
149
+ let uniqueKey = '';
150
+ while (uniqueKey.length < 10) {
151
+ uniqueKey +=
151
152
  availableCharacters[Math.floor(Math.random() * availableCharacters.length)];
152
153
  }
154
+ id = id + uniqueKey;
153
155
  req.headers["X-Request-Id"] = id;
154
156
  asyncLocalStorage.run(id, next);
155
157
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@factorypure/logger",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",