MCPcopy Create free account
hub / github.com/TruthHun/BookStack / looseEqual

Function looseEqual

static/vuejs/vue.runtime.common.js:213–228  ·  view source on GitHub ↗

* Check if two values are loosely equal - that is, * if they are plain objects, do they have the same shape?

(a, b)

Source from the content-addressed store, hash-verified

211 * if they are plain objects, do they have the same shape?
212 */
213function 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
230function looseIndexOf (arr, val) {
231 for (var i = 0; i < arr.length; i++) {

Callers 3

looseIndexOfFunction · 0.70
setSelectedFunction · 0.70
hasNoMatchingOptionFunction · 0.70

Calls 1

isObjectFunction · 0.70

Tested by

no test coverage detected