Socket
Socket
Sign inDemoInstall

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.0.1 to 1.0.2

4

package.json
{
"version": "1.0.1",
"version": "1.0.2",
"name": "har-validator",
"description": "HTTP Archive (HAR) validator using JSON Schema",
"description": "Extremely fast HTTP Archive (HAR) validator using JSON Schema",
"author": "Ahmad Nassri <ahmad@ahmadnassri.com> (https://www.ahmadnassri.com/)",

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -7,8 +7,8 @@ 'use strict';

module.exports = function (data, cb) {
if (!data) {
return false;
var valid = false;
if (data !== undefined) {
// execute is-my-json-valid
valid = validate(data);
}
// execute is-my-json-valid
var valid = validate(data);

@@ -15,0 +15,0 @@ // callback?

@@ -13,7 +13,8 @@ 'use strict';

err[0].should.have.property('message');
err[0].message.should.equal('is required');
err[0].should.have.property('field').and.equal('data.log');
err[0].should.have.property('message').and.equal('is required');
done();
});
done();
});

@@ -25,7 +26,7 @@

err[0].should.have.property('message');
err[0].message.should.equal('is the wrong type');
err[0].should.have.property('field').and.equal('data');
err[0].should.have.property('message').and.equal('is the wrong type');
done();
});
done();
});

@@ -36,5 +37,5 @@

valid.should.be.false;
done();
});
done();
});

@@ -44,7 +45,8 @@

validate(fixtures.invalid.version, function (err, valid) {
err[0].field.should.equal('data.log.version');
err[0].message.should.equal('is the wrong type');
err[0].should.have.property('field').and.equal('data.log.version');
err[0].should.have.property('message').and.equal('is the wrong type');
done();
});
done();
});

@@ -54,15 +56,19 @@

validate(fixtures.invalid.creator, function (err, valid) {
err[0].should.have.property('message');
err[0].message.should.equal('referenced schema does not match');
err[0].should.have.property('field').and.equal('data.log.creator');
err[0].should.have.property('message').and.equal('referenced schema does not match');
done();
});
done();
});
it('should not fail with full example', function () {
it('should not fail with full example', function (done) {
validate(fixtures.valid, function (err, valid) {
valid.should.be.true;
should.not.exist(err);
valid.should.be.true;
done();
});
});
});
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