@centralping/json-api-query
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -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 @@ |
{ | ||
"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>'array'</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>'array'</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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26915
9
136
2
+ Addedajv@^6.5.4
+ Addedajv@6.12.6(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addeduri-js@4.4.1(transitive)