Comparing version 0.5.7 to 0.5.8
@@ -340,10 +340,2 @@ /* eslint no-shadow: 0, no-param-reassign: 0 */ | ||
}, { | ||
key: '_withJoinOne', | ||
value: function _withJoinOne(query, relationName, options) { | ||
var relation = this.getRelation(relationName); | ||
return query.merge(function (row) { | ||
return _defineProperty({}, relationName, relation.coerceType(relation.query(row, options))); | ||
}); | ||
} | ||
}, { | ||
key: 'withJoin', | ||
@@ -354,11 +346,9 @@ value: function withJoin(query, relations) { | ||
return _lodash2['default'].reduce(relations, function (query, relations, key) { | ||
var options = _lodash2['default'].isObject(relations) ? relations : {}; | ||
if (_lodash2['default'].startsWith(key, '_')) return query; | ||
query = _this5._withJoinOne(query, key, options); | ||
if (_lodash2['default'].isObject(relations)) { | ||
(function () { | ||
var relations = _lodash2['default'].omitBy(relations, function (relations, key) { | ||
return _lodash2['default'].startsWith(key, '_'); | ||
}); | ||
var relation = _this5.getRelation(key); | ||
query = query.merge(function (row) { | ||
var relatedQuery = relation.coerceType(relation.query(row, relations)); | ||
if (_lodash2['default'].isObject(relations)) { | ||
var _getRelation = _this5.getRelation(key); | ||
@@ -368,7 +358,8 @@ | ||
query = query.merge(function (row) { | ||
return _defineProperty({}, key, targetTable.withJoin(row(key), relations)); | ||
}); | ||
})(); | ||
} | ||
relatedQuery = targetTable.withJoin(relatedQuery, relations); | ||
} | ||
return _defineProperty({}, key, relatedQuery); | ||
}); | ||
return query; | ||
@@ -375,0 +366,0 @@ }, query); |
{ | ||
"name": "nothinkdb", | ||
"version": "0.5.7", | ||
"version": "0.5.8", | ||
"description": "Functional toolkit for rethinkdb", | ||
@@ -40,3 +40,3 @@ "main": "lib/nothinkdb.js", | ||
"mocha": "^2.4.5", | ||
"rethinkdb": "^2.2.2", | ||
"rethinkdb": "2.2.3", | ||
"rimraf": "^2.5.1" | ||
@@ -43,0 +43,0 @@ }, |
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
34704
729