Socket
Socket
Sign inDemoInstall

simpl-schema

Package Overview
Dependencies
Maintainers
2
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simpl-schema - npm Package Compare versions

Comparing version 1.7.3 to 1.8.0

1

dist/doValidation.js

@@ -245,2 +245,3 @@ "use strict";

},
validationContext: validationContext,
value: val

@@ -247,0 +248,0 @@ }, extendedCustomContext || {}); // Perform validation for this key

2

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

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

@@ -423,2 +423,32 @@ # SimpleSchema (simpl-schema NPM package)

When one of the allowed types is an object, use a subschema. Don't mix the object property definitions in with the main schema.
Correct:
```js
import SimpleSchema from 'simpl-schema';
const objSchema = new SimpleSchema({
_id: String
});
const schema = new SimpleSchema({
foo: SimpleSchema.oneOf(String, objSchema)
});
```
Incorrect:
```js
import SimpleSchema from 'simpl-schema';
const schema = new SimpleSchema({
foo: SimpleSchema.oneOf(String, Object),
'foo._id': {
type: String,
optional: true
}
});
```
NOTE: Multiple definitions is still an experimental feature and may not work as you expect in complex situations, such as where one of the valid definitions is an object or array. By reporting any weirdness you experience, you can help make it more robust.

@@ -799,2 +829,3 @@

- `this.siblingField()`: Use this method to get information about other fields that have the same parent object. Works the same way as `field()`. This is helpful when you use sub-schemas or when you're dealing with arrays of objects.
- `this.validationContext`: The current validation context
- `this.value`: If isSet = true, this contains the field's current (requested) value in the document or modifier.

@@ -801,0 +832,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