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

goodeggs-json-schema-validator

Package Overview
Dependencies
Maintainers
5
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

goodeggs-json-schema-validator - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

12

index.js
'use strict';
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _tv = require('tv4');

@@ -7,2 +9,6 @@

var _assert = require('assert');
var _assert2 = _interopRequireDefault(_assert);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -56,2 +62,4 @@

module.exports.assertValid = function (data, schema) {
(0, _assert2.default)(data !== undefined, 'data must be defined');
(0, _assert2.default)((typeof schema === 'undefined' ? 'undefined' : _typeof(schema)) === 'object', 'schema must be an object');
var cleanedData = JSON.parse(JSON.stringify(data)); // remove undefined, convert dates to ISO strings, etc

@@ -65,3 +73,5 @@

var message = function () {
var result = 'failed schema validation';
var result = 'failed';
if (schema.title) result += ' "' + schema.title + '"';
result += ' schema validation';
if (error.schemaPath.length) result += ' at ' + error.schemaPath;

@@ -68,0 +78,0 @@ result += '; ' + error.message.toLowerCase();

5

package.json
{
"name": "goodeggs-json-schema-validator",
"version": "4.0.0",
"version": "4.1.0",
"description": "Good Eggs JSON Schema Validator",

@@ -61,3 +61,4 @@ "author": "Good Eggs <open-source@goodeggs.com>",

"rules": {
"lodash/prefer-lodash-typecheck": "off"
"lodash/prefer-lodash-typecheck": "off",
"no-eq-null": "off"
},

@@ -64,0 +65,0 @@ "env": {

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