@middy/util 7.2.1 → 7.2.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.
Files changed (2) hide show
  1. package/index.js +3 -3
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -51,7 +51,7 @@ const safeGet = (obj, key) =>
51
51
 
52
52
  // Internal Context
53
53
  export const getInternal = async (variables, request) => {
54
- if (!variables || !request) return {};
54
+ if (!variables || !request) return Object.create(null);
55
55
  let keys = [];
56
56
  let values = [];
57
57
  if (variables === true) {
@@ -86,7 +86,7 @@ export const getInternal = async (variables, request) => {
86
86
  syncResults[i] = value;
87
87
  }
88
88
  if (allSync) {
89
- const obj = {};
89
+ const obj = Object.create(null);
90
90
  for (let i = 0; i < keys.length; i++) {
91
91
  obj[sanitizeKey(keys[i])] = syncResults[i];
92
92
  }
@@ -110,7 +110,7 @@ export const getInternal = async (variables, request) => {
110
110
  // ensure promise has resolved by the time it's needed
111
111
  // If one of the promises throws it will bubble up to @middy/core
112
112
  values = await Promise.allSettled(promises);
113
- const obj = {};
113
+ const obj = Object.create(null);
114
114
  let errors;
115
115
  for (let i = 0; i < keys.length; i++) {
116
116
  if (values[i].status === "rejected") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/util",
3
- "version": "7.2.1",
3
+ "version": "7.2.2",
4
4
  "description": "🛵 The stylish Node.js middleware engine for AWS Lambda (util package)",
5
5
  "type": "module",
6
6
  "engines": {
@@ -60,7 +60,7 @@
60
60
  },
61
61
  "devDependencies": {
62
62
  "@aws-sdk/client-ssm": "^3.0.0",
63
- "@middy/core": "7.2.1",
63
+ "@middy/core": "7.2.2",
64
64
  "@types/aws-lambda": "^8.0.0",
65
65
  "@types/node": "^22.0.0",
66
66
  "aws-xray-sdk": "^3.3.3"