Socket
Socket
Sign inDemoInstall

ajv

Package Overview
Dependencies
Maintainers
1
Versions
355
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ajv - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

1

lib/compile/rules/not.dot.js
function (data, dataType, dataPath) {
'use strict';
/* TODO change to inline ??? */

@@ -5,0 +4,0 @@ var errs = validate.errors.length;

34

lib/compile/rules/required.dot.js

@@ -1,21 +0,17 @@

var valid = true, missing = '';
var req_schema = validate.schema{{= it.schemaPath + '.required' }};
{{ var $req_schema = it.schema.required; }}
{{? $req_schema.length <= 100 }}
var valid = {{~ $req_schema:$req_property:$i }}
{{? $i}} && {{?}}
data.hasOwnProperty('{{= it.escapeQuotes($req_property) }}')
{{~}};
{{??}}
var valid = true;
var req_schema = validate.schema{{= it.schemaPath + '.required' }};
for (var i = 0; i < req_schema.length; i++) {
var property = req_schema[i]
, has = data.hasOwnProperty(req_schema[i])
, valid = valid && has;
for (var i = 0; i < req_schema.length; i++) {
var property = req_schema[i]
, valid = valid && data.hasOwnProperty(req_schema[i]);
if (!has) {
{{? it.opts.allErrors }}
missing += ', ' + property;
{{??}}
missing = property;
break;
{{?}}
{{? !it.opts.allErrors }} if (!valid) break; {{?}}
}
}
{{? it.opts.allErrors }}
missing = missing.slice(2);
{{?}}

@@ -26,4 +22,4 @@

dataPath: dataPath,
message: 'properties ' + missing + ' are missing'
{{? it.opts.verbose }}, schema: req_schema, data: data{{?}}
message: 'properties {{= $req_schema.slice(0, 7).join(",") }}{{? $req_schema.length > 7}}...{{?}} are required'
{{? it.opts.verbose }}, schema: validate.schema{{= it.schemaPath + '.required' }}, data: data{{?}}
});
{
"name": "ajv",
"version": "0.1.2",
"version": "0.1.3",
"description": "Another JSON schema Validator",

@@ -5,0 +5,0 @@ "main": "lib/ajv.js",

@@ -44,2 +44,3 @@ # ajv - Another JSON schema Validator

- _format_: if false, the formats won't be validated (true by default)
- _uniqueItems_: if false, `uniqueItems` keyword will be ignored (true by default)
- _unicode_: if true, the lengths of strings with unicode pairs will be correct (false by default) - not implemented yet.
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