@clipboard-health/json-api
Advanced tools
Comparing version 0.16.0 to 0.17.0
{ | ||
"name": "@clipboard-health/json-api", | ||
"description": "TypeScript-friendly utilities for adhering to the JSON:API specification.", | ||
"version": "0.16.0", | ||
"version": "0.17.0", | ||
"bugs": "https://github.com/ClipboardHealth/core-utils/issues", | ||
@@ -6,0 +6,0 @@ "dependencies": { |
@@ -24,5 +24,5 @@ # @clipboard-health/json-api <!-- omit from toc --> | ||
<!-- prettier-ignore --> | ||
<embedex source="packages/json-api/examples/toClientSearchParams.ts"> | ||
```ts | ||
// packages/json-api/examples/toClientSearchParams.ts | ||
import { deepEqual } from "node:assert/strict"; | ||
@@ -55,10 +55,10 @@ | ||
); | ||
``` | ||
</embedex> | ||
From the server, call `toServerJsonApiQuery` to convert from `URLSearchParams` to `ServerJsonApiQuery`: | ||
<!-- prettier-ignore --> | ||
<embedex source="packages/json-api/examples/toServerJsonApiQuery.ts"> | ||
```ts | ||
// packages/json-api/examples/toServerJsonApiQuery.ts | ||
import { deepEqual } from "node:assert/strict"; | ||
@@ -89,7 +89,8 @@ | ||
}); | ||
``` | ||
</embedex> | ||
## Local development commands | ||
See [`package.json`](./package.json) `scripts` for a list of commands. |
@@ -6,4 +6,5 @@ import { type ClientJsonApiQuery } from "../types"; | ||
* @example | ||
* <embedex source="packages/json-api/examples/toClientSearchParams.ts"> | ||
* | ||
* ```ts | ||
* // packages/json-api/examples/toClientSearchParams.ts | ||
* import { deepEqual } from "node:assert/strict"; | ||
@@ -36,5 +37,6 @@ * | ||
* ); | ||
* ``` | ||
* | ||
* ``` | ||
* </embedex> | ||
*/ | ||
export declare function toClientSearchParams(query: ClientJsonApiQuery): URLSearchParams; |
@@ -14,4 +14,5 @@ "use strict"; | ||
* @example | ||
* <embedex source="packages/json-api/examples/toClientSearchParams.ts"> | ||
* | ||
* ```ts | ||
* // packages/json-api/examples/toClientSearchParams.ts | ||
* import { deepEqual } from "node:assert/strict"; | ||
@@ -44,4 +45,5 @@ * | ||
* ); | ||
* ``` | ||
* | ||
* ``` | ||
* </embedex> | ||
*/ | ||
@@ -48,0 +50,0 @@ function toClientSearchParams(query) { |
@@ -6,4 +6,5 @@ import { type ServerJsonApiQuery } from "../types"; | ||
* @example | ||
* <embedex source="packages/json-api/examples/toServerJsonApiQuery.ts"> | ||
* | ||
* ```ts | ||
* // packages/json-api/examples/toServerJsonApiQuery.ts | ||
* import { deepEqual } from "node:assert/strict"; | ||
@@ -34,5 +35,6 @@ * | ||
* }); | ||
* ``` | ||
* | ||
* ``` | ||
* </embedex> | ||
*/ | ||
export declare function toServerJsonApiQuery(searchParams: URLSearchParams): ServerJsonApiQuery; |
@@ -16,4 +16,5 @@ "use strict"; | ||
* @example | ||
* <embedex source="packages/json-api/examples/toServerJsonApiQuery.ts"> | ||
* | ||
* ```ts | ||
* // packages/json-api/examples/toServerJsonApiQuery.ts | ||
* import { deepEqual } from "node:assert/strict"; | ||
@@ -44,4 +45,5 @@ * | ||
* }); | ||
* ``` | ||
* | ||
* ``` | ||
* </embedex> | ||
*/ | ||
@@ -48,0 +50,0 @@ function toServerJsonApiQuery(searchParams) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
18145
323
94