@tuyau/superjson 1.0.0-beta.0 → 1.0.1

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/README.md CHANGED
@@ -1,2 +1,11 @@
1
1
  # @tuyau/superjson
2
2
 
3
+ SuperJSON plugin for Tuyau and AdonisJS. Allows seamless serialization and deserialization of complex types like Date, Map, Set, etc.
4
+
5
+ ## Documentation
6
+
7
+ Available soon.
8
+
9
+ ## License
10
+
11
+ MIT
@@ -7,7 +7,7 @@ var SuperjsonMiddleware = class {
7
7
  async handle(ctx, next) {
8
8
  const { request, response } = ctx;
9
9
  const isSuperjsonRequest = this.#isSuperJsonRequest(ctx);
10
- if (isSuperjsonRequest && request.hasBody()) {
10
+ if (isSuperjsonRequest && request.hasBody() && request.bodyType === "json") {
11
11
  request.updateBody(SuperJSON.deserialize(request.body()));
12
12
  }
13
13
  await next();
package/package.json CHANGED
@@ -1,11 +1,26 @@
1
1
  {
2
2
  "name": "@tuyau/superjson",
3
3
  "type": "module",
4
- "version": "1.0.0-beta.0",
5
- "description": "Superjson transformer for Tuyau",
4
+ "version": "1.0.1",
5
+ "description": "SuperJSON plugin for Tuyau and AdonisJS",
6
6
  "author": "Julien Ripouteau <julien@ripouteau.com>",
7
7
  "license": "MIT",
8
- "keywords": [],
8
+ "homepage": "https://github.com/Julien-R44/tuyau#readme",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/Julien-R44/tuyau.git",
12
+ "directory": "packages/superjson"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/Julien-R44/tuyau/issues"
16
+ },
17
+ "keywords": [
18
+ "adonisjs",
19
+ "typescript",
20
+ "superjson",
21
+ "serialization",
22
+ "tuyau"
23
+ ],
9
24
  "exports": {
10
25
  ".": "./build/index.js",
11
26
  "./types": "./build/src/types.js",
@@ -22,17 +37,17 @@
22
37
  "@adonisjs/core": "^7.0.0-next.10"
23
38
  },
24
39
  "dependencies": {
25
- "superjson": "^2.2.5"
40
+ "superjson": "^2.2.6"
26
41
  },
27
42
  "devDependencies": {
28
- "@adonisjs/assembler": "^8.0.0-next.19",
29
- "@adonisjs/core": "^7.0.0-next.10",
30
- "nock": "^14.0.10",
31
- "@tuyau/core": "1.0.0-beta.4"
43
+ "@adonisjs/assembler": "^8.5.2",
44
+ "@adonisjs/core": "^7.6.0",
45
+ "nock": "^15.0.1",
46
+ "@tuyau/core": "1.3.0"
32
47
  },
33
48
  "publishConfig": {
34
49
  "access": "public",
35
- "tag": "beta"
50
+ "tag": "latest"
36
51
  },
37
52
  "c8": {
38
53
  "reporter": [