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

@springworks/input-validator

Package Overview
Dependencies
Maintainers
1
Versions
449
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@springworks/input-validator - npm Package Compare versions

Comparing version 3.0.8 to 3.1.0

9

index.js

@@ -7,2 +7,3 @@ 'use strict';

var OBJECTID_REGEX = /^[0-9a-fA-F]{24}$/;
var defaults = require('lodash.defaults');

@@ -113,3 +114,9 @@

function validateSchema(params, schema, opt_resource_name, opt_options) {
var validated = joi.validate(params, schema, opt_options);
var default_options = {
abortEarly: false,
stripUnknown: false,
convert: true,
presence: 'optional',
};
var validated = joi.validate(params, schema, defaults(default_options, opt_options));

@@ -116,0 +123,0 @@ if (validated.error) {

5

package.json
{
"name": "@springworks/input-validator",
"version": "3.0.8",
"version": "3.1.0",
"description": "Module to help validate and filter input parameters.",

@@ -39,4 +39,5 @@ "main": "index.js",

"@springworks/error-factory": "1.2.3",
"joi": "6.9.0"
"joi": "6.9.0",
"lodash.defaults": "^3.1.2"
}
}

@@ -156,14 +156,11 @@ 'use strict';

err.output.payload.validation.should.have.keys([
'number_val'
'number_val', 'date_val', 'object_id'
]);
// Check the restify part.
err.toJSON().should.eql({
message: 'Validation Failed',
errors: [
{
resource: 'resource',
field: 'number_val',
code: 'invalid'
}
{ code: 'invalid', field: 'number_val', resource: 'resource' },
{ code: 'invalid', field: 'date_val', resource: 'resource' },
{ code: 'invalid', field: 'object_id', resource: 'resource' }
]

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