har-validator
Advanced tools
Comparing version 5.1.0 to 5.1.3
@@ -7,2 +7,12 @@ var Ajv = require('ajv') | ||
function createAjvInstance () { | ||
var ajv = new Ajv({ | ||
allErrors: true | ||
}) | ||
ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json')) | ||
ajv.addSchema(schemas) | ||
return ajv | ||
} | ||
function validate (name, data, next) { | ||
@@ -12,6 +22,3 @@ data = data || {} | ||
// validator config | ||
ajv = ajv || new Ajv({ | ||
allErrors: true, | ||
schemas: schemas | ||
}) | ||
ajv = ajv || createAjvInstance() | ||
@@ -18,0 +25,0 @@ var validate = ajv.getSchema(name + '.json') |
@@ -7,2 +7,12 @@ var Ajv = require('ajv') | ||
function createAjvInstance () { | ||
var ajv = new Ajv({ | ||
allErrors: true | ||
}) | ||
ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json')) | ||
ajv.addSchema(schemas) | ||
return ajv | ||
} | ||
function validate (name, data) { | ||
@@ -12,6 +22,3 @@ data = data || {} | ||
// validator config | ||
ajv = ajv || new Ajv({ | ||
allErrors: true, | ||
schemas: schemas | ||
}) | ||
ajv = ajv || createAjvInstance() | ||
@@ -18,0 +25,0 @@ var validate = ajv.getSchema(name + '.json') |
@@ -1,1 +0,47 @@ | ||
{"version":"5.1.0","name":"har-validator","description":"Extremely fast HTTP Archive (HAR) validator using JSON Schema","author":"Ahmad Nassri <ahmad@ahmadnassri.com> (https://www.ahmadnassri.com/)","homepage":"https://github.com/ahmadnassri/har-validator","repository":{"type":"git","url":"https://github.com/ahmadnassri/har-validator.git"},"license":"ISC","main":"lib/promise.js","keywords":["har","cli","ajv","http","archive","validate","validator"],"engines":{"node":">=4"},"files":["lib"],"bugs":{"url":"https://github.com/ahmadnassri/har-validator/issues"},"scripts":{"lint":"standard && echint","pretest":"npm run lint","test":"tap test","coverage":"tap test --reporter silent --coverage"},"devDependencies":{"echint":"^4.0.1","standard":"^10.0.3","tap":"^10.7.2"},"dependencies":{"ajv":"^5.3.0","har-schema":"^2.0.0"}} | ||
{ | ||
"version": "5.1.3", | ||
"name": "har-validator", | ||
"description": "Extremely fast HTTP Archive (HAR) validator using JSON Schema", | ||
"author": "Ahmad Nassri <ahmad@ahmadnassri.com> (https://www.ahmadnassri.com/)", | ||
"homepage": "https://github.com/ahmadnassri/node-har-validator", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ahmadnassri/node-har-validator.git" | ||
}, | ||
"license": "MIT", | ||
"main": "lib/promise.js", | ||
"keywords": [ | ||
"har", | ||
"cli", | ||
"ajv", | ||
"http", | ||
"archive", | ||
"validate", | ||
"validator" | ||
], | ||
"engines": { | ||
"node": ">=6" | ||
}, | ||
"files": [ | ||
"lib" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/ahmadnassri/node-har-validator/issues" | ||
}, | ||
"scripts": { | ||
"lint:deps": "npx updated", | ||
"lint:ec": "npx editorconfig-checker .", | ||
"lint:js": "npx eslint .", | ||
"lint:md": "npx remark --quiet --frail .", | ||
"lint": "npx run-p lint:*", | ||
"open:coverage": "opener coverage/lcov-report/index.html", | ||
"test": "tap test --coverage-report=lcov --no-browser" | ||
}, | ||
"devDependencies": { | ||
"tap": "^12.0.1" | ||
}, | ||
"dependencies": { | ||
"ajv": "^6.5.5", | ||
"har-schema": "^2.0.0" | ||
} | ||
} |
@@ -1,16 +0,11 @@ | ||
# HAR Validator [![version][npm-version]][npm-url] [![License][license-image]][license-url] | ||
# HAR Validator | ||
[![License][license-image]][license-url] [![version][npm-image]][npm-url] [![Build Status][circle-image]][circle-url] | ||
> Extremely fast HTTP Archive ([HAR](https://github.com/ahmadnassri/har-spec/blob/master/versions/1.2.md)) validator using JSON Schema. | ||
[![Build Status][travis-image]][travis-url] | ||
[![Downloads][npm-downloads]][npm-url] | ||
[![Code Climate][codeclimate-quality]][codeclimate-url] | ||
[![Coverage Status][codeclimate-coverage]][codeclimate-url] | ||
[![Dependency Status][dependencyci-image]][dependencyci-url] | ||
[![Dependencies][david-image]][david-url] | ||
## Install | ||
```bash | ||
npm install --only=production --save har-validator | ||
npm install har-validator | ||
``` | ||
@@ -24,32 +19,20 @@ | ||
**Note**: as of [`v2.0.0`](https://github.com/ahmadnassri/har-validator/releases/tag/v2.0.0) this module defaults to Promise based API. *For backward compatibility with `v1.x` an [async/callback API](docs/async.md) is also provided* | ||
**Note**: as of [`v2.0.0`](https://github.com/ahmadnassri/node-har-validator/releases/tag/v2.0.0) this module defaults to Promise based API. _For backward compatibility with `v1.x` an [async/callback API](docs/async.md) is also provided_ | ||
- [async API](docs/async.md) | ||
- [callback API](docs/async.md) | ||
- [Promise API](docs/promise.md) *(default)* | ||
- [Promise API](docs/promise.md) _(default)_ | ||
---- | ||
> :copyright: [ahmadnassri.com](https://www.ahmadnassri.com/) · | ||
> License: [ISC][license-url] · | ||
> Github: [@ahmadnassri](https://github.com/ahmadnassri) · | ||
--- | ||
> Author: [Ahmad Nassri](https://www.ahmadnassri.com/) • | ||
> Github: [@ahmadnassri](https://github.com/ahmadnassri) • | ||
> Twitter: [@ahmadnassri](https://twitter.com/ahmadnassri) | ||
[license-url]: http://choosealicense.com/licenses/isc/ | ||
[license-image]: https://img.shields.io/github/license/ahmadnassri/har-validator.svg?style=flat-square | ||
[license-url]: LICENSE | ||
[license-image]: https://img.shields.io/github/license/ahmadnassri/node-har-validator.svg?style=for-the-badge&logo=circleci | ||
[travis-url]: https://travis-ci.org/ahmadnassri/har-validator | ||
[travis-image]: https://img.shields.io/travis/ahmadnassri/har-validator.svg?style=flat-square | ||
[circle-url]: https://circleci.com/gh/ahmadnassri/workflows/node-har-validator | ||
[circle-image]: https://img.shields.io/circleci/project/github/ahmadnassri/node-har-validator/master.svg?style=for-the-badge&logo=circleci | ||
[npm-url]: https://www.npmjs.com/package/har-validator | ||
[npm-version]: https://img.shields.io/npm/v/har-validator.svg?style=flat-square | ||
[npm-downloads]: https://img.shields.io/npm/dm/har-validator.svg?style=flat-square | ||
[codeclimate-url]: https://codeclimate.com/github/ahmadnassri/har-validator | ||
[codeclimate-quality]: https://img.shields.io/codeclimate/github/ahmadnassri/har-validator.svg?style=flat-square | ||
[codeclimate-coverage]: https://img.shields.io/codeclimate/coverage/github/ahmadnassri/har-validator.svg?style=flat-square | ||
[david-url]: https://david-dm.org/ahmadnassri/har-validator | ||
[david-image]: https://img.shields.io/david/ahmadnassri/har-validator.svg?style=flat-square | ||
[dependencyci-url]: https://dependencyci.com/github/ahmadnassri/har-validator | ||
[dependencyci-image]: https://dependencyci.com/github/ahmadnassri/har-validator/badge?style=flat-square | ||
[npm-image]: https://img.shields.io/npm/v/har-validator.svg?style=for-the-badge&logo=npm |
Sorry, the diff of this file is not supported yet
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
1
167
8226
38
+ Addedajv@6.12.6(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addeduri-js@4.4.1(transitive)
- Removedajv@5.5.2(transitive)
- Removedco@4.6.0(transitive)
- Removedfast-deep-equal@1.1.0(transitive)
- Removedjson-schema-traverse@0.3.1(transitive)
Updatedajv@^6.5.5