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

cormo

Package Overview
Dependencies
Maintainers
1
Versions
173
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cormo - npm Package Compare versions

Comparing version 0.7.3 to 0.7.4

4

lib/adapters/base.js

@@ -54,3 +54,3 @@ // Generated by CoffeeScript 1.7.1

AdapterBase.prototype.valueToModel = function(value, column, property) {
AdapterBase.prototype.valueToModel = function(value, property) {
if (property.type === types.Object || property.array) {

@@ -91,3 +91,3 @@ return JSON.parse(value);

if (property) {
instance[field] = this.valueToModel(data[field], field, property);
instance[field] = this.valueToModel(data[field], property);
}

@@ -94,0 +94,0 @@ }

@@ -402,3 +402,3 @@ // Generated by CoffeeScript 1.7.1

MongoDBAdapter.prototype.valueToModel = function(value, column, property) {
MongoDBAdapter.prototype.valueToModel = function(value, property) {
if (property.type === 'objectid') {

@@ -410,3 +410,3 @@ if (property.array) {

} else {
return _objectIdToString(value);
return value && _objectIdToString(value);
}

@@ -419,5 +419,7 @@ } else {

MongoDBAdapter.prototype._refineRawInstance = function(model, data, selected_columns) {
var column, id, value, _i, _j, _len, _len1;
var column, dont_eliminate_null, id, schema, value, _i, _len;
dont_eliminate_null = !this._connection.models[model].eliminate_null;
schema = this._connection.models[model]._schema;
if (!selected_columns) {
selected_columns = Object.keys(this._connection.models[model]._schema);
selected_columns = Object.keys(schema);
}

@@ -428,5 +430,5 @@ id = _objectIdToString(data._id);

column = selected_columns[_i];
value = data[column];
if (value instanceof ObjectID) {
data[column] = _objectIdToString(value);
value = this.valueToModel(data[column], schema[column]);
if ((value != null) || dont_eliminate_null) {
data[column] = value;
}

@@ -440,10 +442,2 @@ }

});
if (!this._connection.models[model].eliminate_null) {
for (_j = 0, _len1 = selected_columns.length; _j < _len1; _j++) {
column = selected_columns[_j];
if (!data.hasOwnProperty(column)) {
data[column] = null;
}
}
}
return data;

@@ -682,2 +676,6 @@ };

}
} else {
if (column === 'id') {
column = '_id';
}
}

@@ -684,0 +682,0 @@ return orders[column] = dir;

@@ -158,3 +158,3 @@ // Generated by CoffeeScript 1.7.1

MySQLAdapter.prototype.valueToModel = function(value, column, property) {
MySQLAdapter.prototype.valueToModel = function(value, property) {
if (property.type === types.Object || property.array) {

@@ -161,0 +161,0 @@ return JSON.parse(value);

@@ -91,3 +91,3 @@ // Generated by CoffeeScript 1.7.1

RedisAdapter.prototype.valueToModel = function(value, column, property) {
RedisAdapter.prototype.valueToModel = function(value, property) {
switch (property.type) {

@@ -94,0 +94,0 @@ case types.Number:

@@ -187,4 +187,12 @@ // Generated by CoffeeScript 1.7.1

SQLAdapterBase.prototype._refineRawInstance = function(model, data, selected_columns) {
var column, id;
var column, id, schema, _i, _len;
schema = this._connection.models[model]._schema;
if (!selected_columns) {
selected_columns = Object.keys(schema);
}
id = this._getModelID(data);
for (_i = 0, _len = selected_columns.length; _i < _len; _i++) {
column = selected_columns[_i];
data[column] = this.valueToModel(data[column], schema[column]);
}
Object.defineProperty(data, 'id', {

@@ -191,0 +199,0 @@ configurable: false,

@@ -148,3 +148,3 @@ // Generated by CoffeeScript 1.7.1

SQLite3Adapter.prototype.valueToModel = function(value, column, property) {
SQLite3Adapter.prototype.valueToModel = function(value, property) {
if (property.type === types.Object || property.array) {

@@ -151,0 +151,0 @@ return JSON.parse(value);

@@ -293,3 +293,16 @@ // Generated by CoffeeScript 1.7.1

}
return connection.applySchemas();
connection.applySchemas();
return Object.defineProperty(context.console, 'inspect_depth', {
enumrable: true,
get: (function(_this) {
return function() {
return _this.inspect_depth;
};
})(this),
set: (function(_this) {
return function(value) {
return _this.inspect_depth = value;
};
})(this)
});
};

@@ -296,0 +309,0 @@

@@ -349,11 +349,8 @@ // Generated by CoffeeScript 1.7.1

(id_to_record_map[id] || (id_to_record_map[id] = [])).push(record);
} else if (!record.hasOwnProperty(column)) {
Object.defineProperty(record, column, {
enumerable: true,
value: null
});
}
});
ids = Object.keys(id_to_record_map);
query = target_model.find(ids);
query = target_model.where({
id: ids
});
if (select) {

@@ -377,2 +374,10 @@ query.select(select);

});
records.forEach(function(record) {
if (!record.hasOwnProperty(column)) {
Object.defineProperty(record, column, {
enumerable: true,
value: null
});
}
});
return callback(null);

@@ -391,9 +396,16 @@ });

return query.exec(function(error, sub_record) {
if (error) {
if (error && error.message !== 'not found') {
return callback(error);
}
Object.defineProperty(records, column, {
enumerable: true,
value: sub_record
});
if (!error) {
Object.defineProperty(records, column, {
enumerable: true,
value: sub_record
});
} else if (!records.hasOwnProperty(column)) {
Object.defineProperty(records, column, {
enumerable: true,
value: null
});
}
return callback(null);

@@ -400,0 +412,0 @@ });

@@ -290,3 +290,3 @@ // Generated by CoffeeScript 1.7.1

if (value != null) {
value = adapter.valueToModel(value, column, property);
value = adapter.valueToModel(value, property);
} else {

@@ -293,0 +293,0 @@ value = null;

@@ -109,3 +109,3 @@ // Generated by CoffeeScript 1.7.1

if (typeof orders === 'string') {
avaliable_columns = [];
avaliable_columns = ['id'];
[].push.apply(avaliable_columns, Object.keys(this._model._schema));

@@ -112,0 +112,0 @@ if (this._options.group_fields) {

{
"name": "cormo",
"description": "ORM framework for Node.js",
"version": "0.7.3",
"version": "0.7.4",
"keywords": [

@@ -6,0 +6,0 @@ "orm",

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