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

praetorian

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

praetorian - npm Package Compare versions

Comparing version 0.1.10 to 0.2.0

CHANGELOG.md

23

lib/praetorian.js

@@ -341,11 +341,16 @@ /**

if( _.isArray( json[levelKey] ) ) {
// loop each element in the array and parse those as individual objects against their schema
_.each( json[levelKey], function( arrayElement, loopCount ) {
if( !_.isUndefined( arrayElement ) ) {
parseJson( arrayElement, schema[levelKey].items, levelKey + '[' + loopCount + '].' );
} else {
// in this instance, an element in the array was not passed at all , no harm done
// i.e. name[0].initial was not passed but name[1].initial was
}
} );
// Does the schema say there should be items?
if( schema[levelKey].items ) {
// loop each element in the array and parse those as individual objects against their schema
_.each( json[levelKey], function( arrayElement, loopCount ) {
if( !_.isUndefined( arrayElement ) ) {
parseJson( arrayElement, schema[levelKey].items, levelKey + '[' + loopCount + '].' );
} else {
// in this instance, an element in the array was not passed at all , no harm done
// i.e. name[0].initial was not passed but name[1].initial was
}
} );
} else {
// Schema says no "items" and as the value is an array, happy with that
}
} else {

@@ -352,0 +357,0 @@ // ERROR: this value should be an ARRAY but it's not (object of some other description?)

{
"name": "praetorian",
"version": "0.1.10",
"version": "0.2.0",
"description": "A structured JSON parser and validator",

@@ -5,0 +5,0 @@ "main": "index.js",

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