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

simpl-schema

Package Overview
Dependencies
Maintainers
1
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 0.1.0 to 0.1.1

5

CHANGELOG.md
# simpl-schema CHANGELOG
## 0.1.1
- Improved error for missing `type` property
- Use _.contains instead of Array.includes to fix some compatibility issues (thanks @DerekTBrown)
- Various documentation and test fixes
## 0.1.0

@@ -4,0 +9,0 @@

2

dist/clean/setAutoValues.js

@@ -51,3 +51,3 @@ 'use strict';

// If already called for this key, skip it
if (Array.includes(doneKeys, affectedKey)) return;
if (_underscore2.default.contains(doneKeys, affectedKey)) return;

@@ -54,0 +54,0 @@ var fieldParentName = (0, _utility.getParentOfKey)(affectedKey, true);

@@ -318,3 +318,3 @@ 'use strict';

schema.objectKeys().forEach(function (schemaKey) {
if (!Array.includes(presentKeys, schemaKey)) {
if (!_underscore2.default.contains(presentKeys, schemaKey)) {
checkObj({

@@ -365,5 +365,5 @@ val: undefined,

// Remove error types the user doesn't care about
if (Array.includes(ignoreTypes, errObj.type)) return false;
if (_underscore2.default.contains(ignoreTypes, errObj.type)) return false;
// Make sure there is only one error per fieldName
if (Array.includes(addedFieldNames, errObj.name)) return false;
if (_underscore2.default.contains(addedFieldNames, errObj.name)) return false;

@@ -370,0 +370,0 @@ addedFieldNames.push(errObj.name);

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

_underscore2.default.each(schema, function (val, key) {
if (!val.type) throw new Error(key + ' key is missing "type"');
_underscore2.default.each(val.type.definitions, function (def) {

@@ -788,0 +789,0 @@ if (!(def.type instanceof SimpleSchema)) return;

@@ -7,4 +7,10 @@ 'use strict';

var _underscore = require('underscore');
var _underscore2 = _interopRequireDefault(_underscore);
var _SimpleSchema = require('../SimpleSchema');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function allowedValuesValidator() {

@@ -16,3 +22,3 @@ if (!this.valueShouldBeChecked) return;

var isAllowed = Array.includes(allowedValues, this.value);
var isAllowed = _underscore2.default.contains(allowedValues, this.value);
return isAllowed ? true : _SimpleSchema.SimpleSchema.ErrorTypes.VALUE_NOT_ALLOWED;

@@ -19,0 +25,0 @@ }

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

@@ -26,10 +26,10 @@ "author": "Eric Dobbertin <aldeed@gmail.com>",

"prepublish": "npm test && npm run build",
"test": "mocha --compilers js:babel-core/register --recursive 'lib/**/*.tests.js'",
"test": "mocha --compilers js:babel-core/register --recursive \"lib/**/*.tests.js\"",
"test:watch": "npm test -- --watch"
},
"dependencies": {
"clone": "^1.0.2",
"clone": "1.0.2",
"message-box": "0.0.2",
"mongo-object": "0.0.1",
"underscore": "^1.8.3"
"underscore": "1.8.3"
},

@@ -36,0 +36,0 @@ "devDependencies": {

@@ -840,3 +840,7 @@ # simple-schema

```js
SimpleSchema.messages({wrongPassword: "Wrong password"});
SimpleSchema.messageBox.messages({
en: {
wrongPassword: "Wrong password"
}
});

@@ -843,0 +847,0 @@ myValidationContext.addValidationErrors([{name: "password", type: "wrongPassword"}]);

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