Built browser version

pull/2/head
Louis Chatriot 9 years ago
parent c5e1ef7d3f
commit 60df1db0e1
  1. 9
      browser-version/out/nedb.js
  2. 2
      browser-version/out/nedb.min.js

@ -2557,7 +2557,7 @@ function areThingsEqual (a, b) {
// Arrays (no match since arrays are used as a $in) // Arrays (no match since arrays are used as a $in)
// undefined (no match since they mean field doesn't exist and can't be serialized) // undefined (no match since they mean field doesn't exist and can't be serialized)
if (util.isArray(a) || util.isArray(b) || a === undefined || b === undefined) { return false; } if ((!(util.isArray(a) && util.isArray(b)) && (util.isArray(a) || util.isArray(b))) || a === undefined || b === undefined) { return false; }
// General objects (check for deep equality) // General objects (check for deep equality)
// a and b should be objects at this point // a and b should be objects at this point
@ -2776,6 +2776,11 @@ function matchQueryPart (obj, queryKey, queryValue, treatObjAsValue) {
// Check if the value is an array if we don't force a treatment as value // Check if the value is an array if we don't force a treatment as value
if (util.isArray(objValue) && !treatObjAsValue) { if (util.isArray(objValue) && !treatObjAsValue) {
// If the queryValue is an array, try to perform an exact match
if (util.isArray(queryValue)) {
return matchQueryPart(obj, queryKey, queryValue, true);
}
// Check if we are using an array-specific comparison function // Check if we are using an array-specific comparison function
if (queryValue !== null && typeof queryValue === 'object' && !util.isRegExp(queryValue)) { if (queryValue !== null && typeof queryValue === 'object' && !util.isRegExp(queryValue)) {
keys = Object.keys(queryValue); keys = Object.keys(queryValue);
@ -2793,7 +2798,7 @@ function matchQueryPart (obj, queryKey, queryValue, treatObjAsValue) {
// queryValue is an actual object. Determine whether it contains comparison operators // queryValue is an actual object. Determine whether it contains comparison operators
// or only normal fields. Mixed objects are not allowed // or only normal fields. Mixed objects are not allowed
if (queryValue !== null && typeof queryValue === 'object' && !util.isRegExp(queryValue)) { if (queryValue !== null && typeof queryValue === 'object' && !util.isRegExp(queryValue) && !util.isArray(queryValue)) {
keys = Object.keys(queryValue); keys = Object.keys(queryValue);
firstChars = _.map(keys, function (item) { return item[0]; }); firstChars = _.map(keys, function (item) { return item[0]; });
dollarFirstChars = _.filter(firstChars, function (c) { return c === '$'; }); dollarFirstChars = _.filter(firstChars, function (c) { return c === '$'; });

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save