@as-integrations/h3 1.1.4 → 1.1.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.
package/dist/index.cjs CHANGED
@@ -61,11 +61,10 @@ async function normalizeBody(event) {
61
61
  const PayloadMethods = ["PATCH", "POST", "PUT", "DELETE"];
62
62
  if (h3.isMethod(event, PayloadMethods)) {
63
63
  const body = await h3.readRawBody(event);
64
- const content = typeof body === "string" ? body : body?.toString();
65
- if (h3.getRequestHeader(event, "content-type") === "application/json") {
66
- return content ? JSON.parse(content) : {};
64
+ if (h3.getRequestHeader(event, "content-type")?.includes("application/json")) {
65
+ return body ? JSON.parse(body) : {};
67
66
  } else {
68
- return content;
67
+ return body;
69
68
  }
70
69
  }
71
70
  }
package/dist/index.mjs CHANGED
@@ -59,11 +59,10 @@ async function normalizeBody(event) {
59
59
  const PayloadMethods = ["PATCH", "POST", "PUT", "DELETE"];
60
60
  if (isMethod(event, PayloadMethods)) {
61
61
  const body = await readRawBody(event);
62
- const content = typeof body === "string" ? body : body?.toString();
63
- if (getRequestHeader(event, "content-type") === "application/json") {
64
- return content ? JSON.parse(content) : {};
62
+ if (getRequestHeader(event, "content-type")?.includes("application/json")) {
63
+ return body ? JSON.parse(body) : {};
65
64
  } else {
66
- return content;
65
+ return body;
67
66
  }
68
67
  }
69
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@as-integrations/h3",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "An Apollo Server integration for use with h3 or Nuxt",
5
5
  "repository": "github:apollo-server-integrations/apollo-server-integration-h3",
6
6
  "license": "MIT",
@@ -24,28 +24,28 @@
24
24
  "h3": "^0.8.6 || ^1.0.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@apollo/server": "^4.1.1",
28
- "@apollo/server-integration-testsuite": "^4.1.1",
27
+ "@apollo/server": "^4.3.1",
28
+ "@apollo/server-integration-testsuite": "^4.3.1",
29
29
  "@apollo/utils.withrequired": "^2.0.0",
30
- "@jest/globals": "^29.2.2",
30
+ "@jest/globals": "^29.3.1",
31
31
  "@nuxtjs/eslint-config-typescript": "^12.0.0",
32
- "@typescript-eslint/eslint-plugin": "^5.42.0",
33
- "@typescript-eslint/parser": "^5.42.0",
34
- "@vitest/coverage-c8": "^0.24.5",
35
- "eslint": "^8.27.0",
36
- "eslint-config-prettier": "^8.5.0",
32
+ "@typescript-eslint/eslint-plugin": "^5.48.2",
33
+ "@typescript-eslint/parser": "^5.48.2",
34
+ "@vitest/coverage-c8": "^0.27.2",
35
+ "eslint": "^8.32.0",
36
+ "eslint-config-prettier": "^8.6.0",
37
37
  "eslint-plugin-unused-imports": "^2.0.0",
38
38
  "graphql": "^16.6.0",
39
- "h3": "^1.0.1",
40
- "jest": "^29.2.2",
41
- "prettier": "^2.7.1",
39
+ "h3": "^1.0.2",
40
+ "jest": "^29.3.1",
41
+ "prettier": "^2.8.3",
42
42
  "standard-version": "^9.5.0",
43
- "ts-jest": "^29.0.3",
44
- "typescript": "^4.8.4",
45
- "unbuild": "^1.0.1",
46
- "vitest": "^0.24.5"
43
+ "ts-jest": "^29.0.5",
44
+ "typescript": "^4.9.4",
45
+ "unbuild": "^1.1.1",
46
+ "vitest": "^0.27.2"
47
47
  },
48
- "packageManager": "pnpm@7.14.2",
48
+ "packageManager": "pnpm@7.25.1",
49
49
  "scripts": {
50
50
  "build": "unbuild",
51
51
  "test": "vitest dev",