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