* Check if two values are loosely equal - that is, * if they are plain objects, do they have the same shape?
(a, b)
| 211 | * if they are plain objects, do they have the same shape? |
| 212 | */ |
| 213 | function looseEqual (a, b) { |
| 214 | var isObjectA = isObject(a); |
| 215 | var isObjectB = isObject(b); |
| 216 | if (isObjectA && isObjectB) { |
| 217 | try { |
| 218 | return JSON.stringify(a) === JSON.stringify(b) |
| 219 | } catch (e) { |
| 220 | // possible circular reference |
| 221 | return a === b |
| 222 | } |
| 223 | } else if (!isObjectA && !isObjectB) { |
| 224 | return String(a) === String(b) |
| 225 | } else { |
| 226 | return false |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | function looseIndexOf (arr, val) { |
| 231 | for (var i = 0; i < arr.length; i++) { |
no test coverage detected