Comparing version 3.0.0 to 3.1.0
@@ -0,4 +1,21 @@ | ||
### v3.1.0 | ||
- Add `enumerable` flag to exclude instance properties from enumeration (#724) | ||
### v3.0.0 | ||
- Rename cache -> identityCache & disabled by default (#350, #564, #626, #672, #684, #694, #721) | ||
- Rename `cache` -> `identityCache` and **disable by default** (#350, #564, #626, #672, #684, #694, #721) | ||
**This is a potentially breaking change:** | ||
```js | ||
User.get(14, (err, userA) => | ||
User.get(14, (err, userB) => | ||
// v2 | ||
userA == userB | ||
userA.id == userB.id | ||
// v3, identity cache is now disabled by default | ||
userA != userB | ||
userA.id == userB.id | ||
) | ||
) | ||
``` | ||
### v2.1.29 | ||
@@ -5,0 +22,0 @@ - Fix hasOne association when ID is 0 (#681) |
@@ -105,3 +105,3 @@ var _ = require("lodash"); | ||
remove: function (cb) { | ||
var keys = _.pluck(opts.keyProperties, 'mapsTo'); | ||
var keys = _.map(opts.keyProperties, 'mapsTo'); | ||
@@ -108,0 +108,0 @@ opts.driver.find(keys, opts.table, prepareConditions(), { |
@@ -522,3 +522,3 @@ var Utilities = require("./Utilities"); | ||
}, | ||
enumerable: true | ||
enumerable: !(prop && !prop.enumerable) | ||
}); | ||
@@ -525,0 +525,0 @@ }; |
@@ -710,3 +710,3 @@ var _ = require("lodash"); | ||
// If no keys are defined add the default one | ||
if (opts.keys.length == 0 && !_.any(opts.properties, { key: true })) { | ||
if (opts.keys.length == 0 && !_.some(opts.properties, { key: true })) { | ||
opts.properties[opts.settings.get("properties.primary_key")] = { | ||
@@ -713,0 +713,0 @@ type: 'serial', key: true, required: false, klass: 'primary' |
@@ -43,3 +43,3 @@ var _ = require('lodash'); | ||
throw new ORMError("Unknown property type: " + opts.prop.type, 'NO_SUPPORT'); | ||
} | ||
} | ||
@@ -50,2 +50,7 @@ if (!opts.prop.hasOwnProperty("required") && opts.settings.get("properties.required")) { | ||
// Defaults to true. Setting to false hides properties from JSON.stringify(modelInstance). | ||
if (!opts.prop.hasOwnProperty("enumerable") || opts.prop.enumerable === true) { | ||
opts.prop.enumerable = true; | ||
} | ||
// Defaults to true. Rational means floating point here. | ||
@@ -52,0 +57,0 @@ if (opts.prop.type == "number" && opts.prop.rational === undefined) { |
@@ -44,3 +44,9 @@ var _ = require('lodash'); | ||
get: function (key, def) { | ||
return _.cloneDeep(get(key, def, settings)); | ||
var v = get(key, def, settings) | ||
if (v instanceof Function) { | ||
return v; | ||
} else { | ||
return _.cloneDeep(v); | ||
} | ||
}, | ||
@@ -47,0 +53,0 @@ unset: function () { |
@@ -15,3 +15,3 @@ { | ||
], | ||
"version" : "3.0.0", | ||
"version" : "3.1.0", | ||
"license" : "MIT", | ||
@@ -44,16 +44,16 @@ "homepage" : "http://dresende.github.io/node-orm2", | ||
"hat" : "0.0.3", | ||
"lodash" : "2.4.1", | ||
"lodash" : "4.11.2", | ||
"path-is-absolute" : "1.0.0" | ||
}, | ||
"devDependencies": { | ||
"mysql" : "2.9.0", | ||
"pg" : "4.4.3", | ||
"sqlite3" : "3.1.0", | ||
"async" : "1.5.0", | ||
"mocha" : "2.3.3", | ||
"should" : "1.2.2", | ||
"mongodb" : "1.3.19", | ||
"glob" : "5.0.15" | ||
"mysql" : "2.10.2", | ||
"pg" : "4.5.5", | ||
"sqlite3" : "3.1.3", | ||
"async" : "1.5.2", | ||
"mocha" : "2.4.5", | ||
"should" : "8.3.1", | ||
"mongodb" : "1.4.10", | ||
"glob" : "7.0.3" | ||
}, | ||
"optionalDependencies": {} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
237511
6017
+ Addedlodash@4.11.2(transitive)
Updatedlodash@4.11.2