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

har-validator

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

har-validator - npm Package Compare versions

Comparing version 1.6.0 to 1.6.1

src/error.js

2

package.json
{
"version": "1.6.0",
"version": "1.6.1",
"name": "har-validator",

@@ -4,0 +4,0 @@ "description": "Extremely fast HTTP Archive (HAR) validator using JSON Schema",

'use strict'
var schemas = require('./schemas')
var ValidationError = require('./error')
var validator = require('is-my-json-valid')
function ValidationError (errors) {
this.name = 'ValidationError'
this.errors = errors
}
ValidationError.prototype = Error.prototype
// is-my-json-valid does not provide meaningful error messages for external schemas
// this is a workaround
schemas.cache.properties.beforeRequest = schemas.cacheEntry
schemas.cache.properties.afterRequest = schemas.cacheEntry
schemas.page.properties.pageTimings = schemas.pageTimings
schemas.request.properties.cookies.items = schemas.cookie
schemas.request.properties.headers.items = schemas.record
schemas.request.properties.queryString.items = schemas.record
schemas.request.properties.postData = schemas.postData
schemas.response.properties.cookies.items = schemas.cookie
schemas.response.properties.headers.items = schemas.record
schemas.response.properties.content = schemas.content
schemas.entry.properties.request = schemas.request
schemas.entry.properties.response = schemas.response
schemas.entry.properties.cache = schemas.cache
schemas.entry.properties.timings = schemas.timings
schemas.log.properties.creator = schemas.creator
schemas.log.properties.browser = schemas.creator
schemas.log.properties.pages.items = schemas.page
schemas.log.properties.entries.items = schemas.entry
schemas.har.properties.log = schemas.log
var runner = function (schema, data, cb) {

@@ -42,0 +8,0 @@ var validate = validator(schema, {

'use strict'
module.exports = {
var schemas = {
cache: require('./cache.json'),

@@ -20,1 +20,31 @@ cacheEntry: require('./cacheEntry.json'),

}
// is-my-json-valid does not provide meaningful error messages for external schemas
// this is a workaround
schemas.cache.properties.beforeRequest = schemas.cacheEntry
schemas.cache.properties.afterRequest = schemas.cacheEntry
schemas.page.properties.pageTimings = schemas.pageTimings
schemas.request.properties.cookies.items = schemas.cookie
schemas.request.properties.headers.items = schemas.record
schemas.request.properties.queryString.items = schemas.record
schemas.request.properties.postData = schemas.postData
schemas.response.properties.cookies.items = schemas.cookie
schemas.response.properties.headers.items = schemas.record
schemas.response.properties.content = schemas.content
schemas.entry.properties.request = schemas.request
schemas.entry.properties.response = schemas.response
schemas.entry.properties.cache = schemas.cache
schemas.entry.properties.timings = schemas.timings
schemas.log.properties.creator = schemas.creator
schemas.log.properties.browser = schemas.creator
schemas.log.properties.pages.items = schemas.page
schemas.log.properties.entries.items = schemas.entry
schemas.har.properties.log = schemas.log
module.exports = schemas
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