@clipboard-health/json-api
Advanced tools
Comparing version 0.5.0 to 0.6.0
{ | ||
"name": "@clipboard-health/json-api", | ||
"description": "Utilities for adhering to the JSON:API specification.", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"bugs": "https://github.com/clipboardhealth/core-utils/issues", | ||
@@ -6,0 +6,0 @@ "dependencies": { |
@@ -1,6 +0,6 @@ | ||
# @clipboard-health/json-api | ||
# @clipboard-health/json-api <!-- omit from toc --> | ||
Utilities for adhering to the [JSON:API](https://jsonapi.org/) specification. | ||
## Table of Contents | ||
## Table of contents <!-- omit from toc --> | ||
@@ -36,3 +36,3 @@ - [Install](#install) | ||
const query: ClientJsonApiQuery = { | ||
fields: { user: ["age", "name"] }, | ||
fields: { user: ["age", "dateOfBirth"] }, | ||
filter: { | ||
@@ -53,3 +53,3 @@ age: { eq: ["2"] }, | ||
new URLSearchParams( | ||
`fields[user]=age,name&filter[age]=2&filter[dateOfBirth][gt]=${date1}&filter[dateOfBirth][lt]=${date2}&filter[isActive]=true&include=article&page[size]=10&sort=-age`, | ||
`fields[user]=age,dateOfBirth&filter[age]=2&filter[dateOfBirth][gt]=${date1}&filter[dateOfBirth][lt]=${date2}&filter[isActive]=true&include=article&page[size]=10&sort=-age`, | ||
).toString(), | ||
@@ -73,3 +73,3 @@ ); | ||
const searchParams = new URLSearchParams( | ||
`fields[user]=age,name&filter[age]=2&filter[dateOfBirth][gt]=${date1}&filter[dateOfBirth][lt]=${date2}&filter[isActive]=true&include=article&page[size]=10&sort=-age`, | ||
`fields[user]=age,dateOfBirth&filter[age]=2&filter[dateOfBirth][gt]=${date1}&filter[dateOfBirth][lt]=${date2}&filter[isActive]=true&include=article&page[size]=10&sort=-age`, | ||
); | ||
@@ -80,3 +80,3 @@ | ||
deepEqual(query, { | ||
fields: { user: ["age", "name"] }, | ||
fields: { user: ["age", "dateOfBirth"] }, | ||
filter: { | ||
@@ -83,0 +83,0 @@ age: { eq: ["2"] }, |
14558