ag-common 0.0.83 → 0.0.84

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.
@@ -58,7 +58,7 @@ function validateOpenApi({ event, next, authorized, schema, COGNITO_USER_POOL_ID
58
58
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
59
59
  params: undefined,
60
60
  query: event.queryStringParameters,
61
- body: event.body && JSON.parse(event.body),
61
+ body: (0, object_1.tryJsonParse)(event.body, event.body),
62
62
  headers: (0, object_1.objectKeysToLowerCase)(event === null || event === void 0 ? void 0 : event.headers),
63
63
  };
64
64
  const method = event.requestContext.httpMethod.toLowerCase();
@@ -116,7 +116,7 @@ function validateOpenApi({ event, next, authorized, schema, COGNITO_USER_POOL_ID
116
116
  const res = yield next({
117
117
  params,
118
118
  event,
119
- body: (event.body && JSON.parse(event.body)),
119
+ body: (0, object_1.tryJsonParse)(event.body, event.body),
120
120
  userProfile,
121
121
  lang: (0, i18n_1.getValidatedLang)((_e = event.headers['x-lang']) !== null && _e !== void 0 ? _e : ''),
122
122
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ag-common",
3
- "version": "0.0.83",
3
+ "version": "0.0.84",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Andrei Gec <@andreigec> (https://gec.dev/)",