@spoosh/plugin-qs 0.1.0-beta.0 → 0.1.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.
package/README.md CHANGED
@@ -13,13 +13,14 @@ npm install @spoosh/plugin-qs
13
13
  ## Usage
14
14
 
15
15
  ```typescript
16
+ import { Spoosh } from "@spoosh/core";
16
17
  import { qsPlugin } from "@spoosh/plugin-qs";
17
18
 
18
- const plugins = [
19
- qsPlugin({ arrayFormat: "brackets" }), // default
20
- ];
19
+ const client = new Spoosh<ApiSchema, Error>("/api")
20
+ .use([
21
+ qsPlugin({ arrayFormat: "brackets" }),
22
+ ]);
21
23
 
22
- // Query object
23
24
  const query = {
24
25
  pagination: { limit: 10, offset: 0 },
25
26
  filters: { status: "active", tags: ["a", "b"] },
package/dist/index.d.mts CHANGED
@@ -43,7 +43,13 @@ type QsWriteResult = object;
43
43
  *
44
44
  * @example
45
45
  * ```ts
46
- * const plugins = [qsPlugin({ arrayFormat: "brackets" })];
46
+ * import { Spoosh } from "@spoosh/core";
47
+ *
48
+ * const client = new Spoosh<ApiSchema, Error>("/api")
49
+ * .use([
50
+ * // ... other plugins
51
+ * qsPlugin({ arrayFormat: "brackets" }),
52
+ * ]);
47
53
  *
48
54
  * // Query: { filters: { status: "active", tags: ["a", "b"] } }
49
55
  * // Result: filters[status]=active&filters[tags][]=a&filters[tags][]=b
package/dist/index.d.ts CHANGED
@@ -43,7 +43,13 @@ type QsWriteResult = object;
43
43
  *
44
44
  * @example
45
45
  * ```ts
46
- * const plugins = [qsPlugin({ arrayFormat: "brackets" })];
46
+ * import { Spoosh } from "@spoosh/core";
47
+ *
48
+ * const client = new Spoosh<ApiSchema, Error>("/api")
49
+ * .use([
50
+ * // ... other plugins
51
+ * qsPlugin({ arrayFormat: "brackets" }),
52
+ * ]);
47
53
  *
48
54
  * // Query: { filters: { status: "active", tags: ["a", "b"] } }
49
55
  * // Result: filters[status]=active&filters[tags][]=a&filters[tags][]=b
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spoosh/plugin-qs",
3
- "version": "0.1.0-beta.0",
3
+ "version": "0.1.2",
4
4
  "description": "Query string serialization plugin for Spoosh with nested object support",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -37,12 +37,12 @@
37
37
  "qs": "^6.13.0"
38
38
  },
39
39
  "peerDependencies": {
40
- "@spoosh/core": ">=0.1.0"
40
+ "@spoosh/core": ">=0.3.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/qs": "^6.9.17",
44
- "@spoosh/core": "0.1.0-beta.0",
45
- "@spoosh/test-utils": "0.1.0-beta.0"
44
+ "@spoosh/core": "0.3.0",
45
+ "@spoosh/test-utils": "0.1.3"
46
46
  },
47
47
  "scripts": {
48
48
  "dev": "tsup --watch",