不要怂,就是干,撸起袖子干!

Commit b8ba4a25 by Jochem Maas

replace custom "deep" clone cruft with lo-dash deepClone() (seeing as we now hav…

…e lo-dash as a replacement for underscore)
1 parent 99ed04c7
Showing with 2 additions and 21 deletions
......@@ -297,28 +297,9 @@ module.exports = (function() {
}
DAOFactory.prototype.findAndCountAll = function(options) {
// this 'options cloner' is a bit hacky, should probably
// be somewhere more central -- we essentailly need this
// because in certain cases the "where" property of an options
// object is clobbered (shallow clone does not help) by a method named
// "getWhereConditions" (I think)
var clone = function(v, repls) {
if (Utils._.isObject(v)) {
v = Utils._.clone(v);
if (Utils._.isObject(v.where))
v.where = Utils._.clone(v.where);
}
if (Utils._.isObject(repls))
v = Utils._.extend({}, v || {}, repls);
return v;
};
var self = this
, opts = clone(options)
, copts = clone(options, {
, opts = Utils._.cloneDeep(options)
, copts = Utils._.extend({}, Utils._.cloneDeep(options) || {}, {
// no limit, offset, order or include for the options given to count()
offset : 0,
limit : 0,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!