New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

wadofgum-json-schema

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wadofgum-json-schema - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0

4

CHANGELOG.md
## Changelog
+ 0.3.1 - improved returned error object form z-schema
+ 0.4.0 - minor bump for removing deps, updating wadofgum version and for validating schema being set on static method
+ 0.3.1 - improved returned error object form z-schema
+ 0.3.0 - updated dependencies and added validator static property to pass reference of z-schema to class instance
'use strict';
const Validate = require('./validate.js');

@@ -10,3 +9,2 @@ module.exports = function (baseClass) {

Validate.assert('Schema', rawSchema);
this.meta.set('metaSchema', rawSchema.metaSchema);

@@ -13,0 +11,0 @@ this.meta.set('schema', rawSchema.schema);

{
"name": "wadofgum-json-schema",
"version": "0.3.1",
"version": "0.4.0",
"description": "json schema validation for wadofgum models",

@@ -29,7 +29,3 @@ "main": "lib/index.js",

"z-schema": "^3.16.0"
},
"dependencies": {
"hoek": "^3.0.1",
"joi": "^7.0.0"
}
}
'use strict';
const Code = require('code');
const Hoek = require('hoek');
// const Hoek = require('hoek');
const Lab = require('lab');

@@ -31,14 +31,14 @@ const Wadofgum = require('wadofgum');

it('should throw if invalid rawSchema used is invalid', (done) => {
// it('should throw if invalid rawSchema used is invalid', (done) => {
//
// class Person extends Wadofgum.mixin(Validation) {};
// const InvalidSchema = Hoek.clone(PersonSchema);
// delete InvalidSchema.metaSchema;
// expect(() => {
//
// Person.schema = InvalidSchema;
// }).to.throw(Error);
// done();
// });
class Person extends Wadofgum.mixin(Validation) {};
const InvalidSchema = Hoek.clone(PersonSchema);
delete InvalidSchema.metaSchema;
expect(() => {
Person.schema = InvalidSchema;
}).to.throw(Error);
done();
});
it('errors when attempting to validate a model with no schema', (done) => {

@@ -45,0 +45,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