Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@centralping/json-api-query

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@centralping/json-api-query - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

14

CHANGELOG.md

@@ -0,1 +1,15 @@

#### v0.0.3 (2018-10-06)
##### Chores
* **package:** remove unused dev dependency ([89239b82](https://github.com/CentralPing/json-api-query/commit/89239b828e850cadc6c14d53a8b74f25e3dd8d12))
##### Documentation Changes
* **readme:** add example for AJV options; correct optional schema example ([9f788af9](https://github.com/CentralPing/json-api-query/commit/9f788af940e0f26fb9039d18166d74662b892f94))
##### Bug Fixes
* **package:** include AJV as a dependency ([32f74354](https://github.com/CentralPing/json-api-query/commit/32f743544eea570a8c92dbaf6136ab86a79c7060))
#### v0.0.2 (2018-10-04)

@@ -2,0 +16,0 @@

7

package.json
{
"name": "@centralping/json-api-query",
"version": "0.0.2",
"version": "0.0.3",
"publishConfig": {

@@ -40,6 +40,6 @@ "access": "public"

"dependencies": {
"ajv": "^6.5.4",
"esm": "^3.0.84"
},
"devDependencies": {
"ajv": "^6.5.4",
"coveralls": "^3.0.2",

@@ -53,4 +53,3 @@ "eslint": "^5.6.1",

"jest": "^23.6.0",
"jsdoc-to-markdown": "^4.0.1",
"micro-dev": "^3.0.0"
"jsdoc-to-markdown": "^4.0.1"
},

@@ -57,0 +56,0 @@ "jest": {

@@ -41,5 +41,5 @@ # @CentralPing/json-api-query

### jsonApiQuery~schema : <code>Object</code>
Module property that generates a new deep copy of the default schema on every import. Apply
any extensions and provide as an optional schema for the `validate`
method.
Module property that generates a new deep copy of the default schema
on every import. Apply any extensions and provide as an optional schema
for the `validate` method.

@@ -55,5 +55,5 @@ **Kind**: inner property of [<code>jsonApiQuery</code>](#module_jsonApiQuery)

| --- | --- | --- | --- |
| [options] | <code>Object</code> | | any AJV option |
| [options.coerceTypes] | <code>Boolean</code> \| <code>String</code> | <code>&#x27;array&#x27;</code> | coerce validated values to specified types |
| [options.ownProperties] | <code>Boolean</code> | <code>true</code> | restrict validation to own properties of data object |
| [options] | <code>Object</code> | | any AJV option. |
| [options.coerceTypes] | <code>Boolean</code> \| <code>String</code> | <code>&#x27;array&#x27;</code> | coerce validated values to specified types. |
| [options.ownProperties] | <code>Boolean</code> | <code>true</code> | restrict validation to own properties of data object. |
| [schema] | <code>Object</code> | | JSON Schema. Defaults to the included `schema`. |

@@ -93,3 +93,3 @@

```js
const {validate, json-schema} = require('json-api-query');
const {validate, schema} = require('json-api-query');

@@ -109,2 +109,17 @@ // extend schema

### For AJV options
```js
const {validate} = require('json-api-query');
const validator = validate({allErrors: true});
// queryParams would be an query param object to validate/coerce
const valid = validator(queryParams);
if (!valid) {
// Log errors
console.log(validator.errors);
}
## Test

@@ -111,0 +126,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc