You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

simpl-schema

Package Overview
Dependencies
14
Maintainers
2
Versions
73
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.5.4 to 1.5.5

28

dist/clean.js

@@ -35,2 +35,6 @@ 'use strict';

var _typeValidator = require('./validation/typeValidator');
var _typeValidator2 = _interopRequireDefault(_typeValidator);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -108,11 +112,23 @@

var outerDef = ss.schema(gKey);
var def = outerDef && outerDef.type.definitions[0];
var defs = outerDef && outerDef.type.definitions;
var def = defs && defs[0];
// Autoconvert values if requested and if possible
if (options.autoConvert && def) {
var newVal = (0, _convertToProperType2.default)(val, def.type);
if (newVal !== undefined && newVal !== val) {
_SimpleSchema.SimpleSchema.debug && console.info('SimpleSchema.clean: autoconverted value ' + val + ' from ' + (typeof val === 'undefined' ? 'undefined' : _typeof(val)) + ' to ' + (typeof newVal === 'undefined' ? 'undefined' : _typeof(newVal)) + ' for ' + gKey);
val = newVal;
this.updateValue(newVal);
var isValidType = defs.some(function (definition) {
var errors = _typeValidator2.default.call({
valueShouldBeChecked: true,
definition: definition,
value: val
});
return errors === undefined;
});
if (!isValidType) {
var newVal = (0, _convertToProperType2.default)(val, def.type);
if (newVal !== undefined && newVal !== val) {
_SimpleSchema.SimpleSchema.debug && console.info('SimpleSchema.clean: autoconverted value ' + val + ' from ' + (typeof val === 'undefined' ? 'undefined' : _typeof(val)) + ' to ' + (typeof newVal === 'undefined' ? 'undefined' : _typeof(newVal)) + ' for ' + gKey);
val = newVal;
this.updateValue(newVal);
}
}

@@ -119,0 +135,0 @@ }

{
"name": "simpl-schema",
"version": "1.5.4",
"version": "1.5.5",
"description": "A schema validation package that supports direct validation of MongoDB update modifier objects.",

@@ -5,0 +5,0 @@ "author": "Eric Dobbertin <aldeed@gmail.com>",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc