Socket
Socket
Sign inDemoInstall

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.0.2 to 0.0.3

36

dist/SimpleSchema.js

@@ -172,4 +172,8 @@ 'use strict';

/**
* @param {String} [key] One specific or generic key for which to get the schema
* @returns {Object} The entire schema object or just the definition for one key
* @param {String} [key] One specific or generic key for which to get the schema.
* @returns {Object} The entire schema object or just the definition for one key.
*
* Note that this returns the raw, unevaluated definition object. Use `getDefinition`
* if you want the evaluated definition, where any properties that are functions
* have been run to produce a result.
*/

@@ -196,2 +200,30 @@

/**
* @returns {Object} The entire schema object with subschemas merged. This is the
* equivalent of what schema() returned in SimpleSchema < 2.0
*
* Note that this returns the raw, unevaluated definition object. Use `getDefinition`
* if you want the evaluated definition, where any properties that are functions
* have been run to produce a result.
*/
}, {
key: 'mergedSchema',
value: function mergedSchema() {
var mergedSchema = {};
_underscore2.default.each(this._schema, function (keySchema, key) {
mergedSchema[key] = keySchema;
keySchema.type.definitions.forEach(function (typeDef) {
if (!(typeDef.type instanceof SimpleSchema)) return;
_underscore2.default.each(typeDef.type.mergedSchema(), function (subKeySchema, subKey) {
mergedSchema[key + '.' + subKey] = subKeySchema;
});
});
});
return mergedSchema;
}
/**
* Returns the evaluated definition for one key in the schema

@@ -198,0 +230,0 @@ *

4

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

@@ -25,3 +25,3 @@ "author": "Eric Dobbertin <aldeed@gmail.com>",

"lint:fix": "eslint . --fix || true",
"prepublish": "npm test && npm build",
"prepublish": "npm test && npm run build",
"test": "mocha --compilers js:babel-core/register --recursive 'lib/**/*.tests.js'",

@@ -28,0 +28,0 @@ "test:watch": "npm test -- --watch"

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