|
|
@ -131,6 +131,20 @@ function deepCopy (obj) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Tells if an object is a primitive type or a "real" object |
|
|
|
|
|
|
|
* Arrays are considered primitive |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
function isPrimitiveType (obj) { |
|
|
|
|
|
|
|
return ( typeof obj === 'boolean' || |
|
|
|
|
|
|
|
typeof obj === 'number' || |
|
|
|
|
|
|
|
typeof obj === 'string' || |
|
|
|
|
|
|
|
obj === null || |
|
|
|
|
|
|
|
util.isDate(obj) || |
|
|
|
|
|
|
|
util.isArray(obj)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Utility functions for comparing things |
|
|
|
* Utility functions for comparing things |
|
|
|
* Assumes type checking was already done (a and b already have the same type) |
|
|
|
* Assumes type checking was already done (a and b already have the same type) |
|
|
@ -631,8 +645,7 @@ function match (obj, query) { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function matchQueryPart (obj, queryKey, queryValue) { |
|
|
|
function matchQueryPart (obj, queryKey, queryValue) { |
|
|
|
var objValue = getDotValue(obj, queryKey) |
|
|
|
var objValue = getDotValue(obj, queryKey) |
|
|
|
, i |
|
|
|
, i, keys, firstChars, dollarFirstChars |
|
|
|
, keys, firstChars, dollarFirstChars |
|
|
|
|
|
|
|
; |
|
|
|
; |
|
|
|
|
|
|
|
|
|
|
|
// Check if the object value is an array treat it as an array of { obj, query }
|
|
|
|
// Check if the object value is an array treat it as an array of { obj, query }
|
|
|
|