New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

waterline

Package Overview
Dependencies
Maintainers
2
Versions
165
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

waterline - npm Package Compare versions

Comparing version 0.9.13 to 0.9.14

lib/waterline/query/dql-old.js

5

lib/waterline/core/index.js

@@ -83,4 +83,7 @@ /**

// If adapter exposes any reserved attributes, pass them to the schema
var reservedAttributes = adapterInfo.adapter.reservedAttributes || {};
// Initialize internal objects from attributes
this._schema.initialize(this.attributes, this.hasSchema);
this._schema.initialize(this.attributes, this.hasSchema, reservedAttributes);
this._cast.initialize(this._schema.schema);

@@ -87,0 +90,0 @@ this._validator.initialize(this.attributes, this.types);

10

lib/waterline/core/schema.js

@@ -48,3 +48,5 @@ /**

Schema.prototype.initialize = function(attrs, hasSchema) {
Schema.prototype.initialize = function(attrs, hasSchema, reservedAttributes) {
var self = this;
for(var key in attrs) {

@@ -54,2 +56,8 @@ this.schema[key] = this.objectAttribute(attrs[key]);

if(Array.isArray(reservedAttributes)) {
reservedAttributes.forEach(function(key) {
self.schema[key] = {};
});
}
// Set hasSchema to determine if values should be cleansed or not

@@ -56,0 +64,0 @@ this.hasSchema = typeof hasSchema !== 'undefined' ? hasSchema : true;

{
"name": "waterline",
"description": "An ORM for Node.js and the Sails framework",
"version": "0.9.13",
"version": "0.9.14",
"contributors": [

@@ -6,0 +6,0 @@ {

@@ -16,5 +16,5 @@ var Validator = require('../../../lib/waterline/core/validations'),

},
employed: {
type: 'boolean',
required: true
employed: {
type: 'boolean',
required: true
},

@@ -29,3 +29,3 @@ age: { type: 'integer' }

it('should error if no value is set for required string field', function(done) {
validator.validate({ name: ' ', employed: true, age: 27 }, function(errors) {
validator.validate({ name: '', employed: true, age: 27 }, function(errors) {
assert(errors.ValidationError);

@@ -37,3 +37,3 @@ assert(errors.ValidationError.name);

});
it('should error if no value is set for required boolean field', function(done) {

@@ -40,0 +40,0 @@ validator.validate({ name: 'Frederick P. Frederickson', age: 27 }, function(errors) {

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