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

Function looseEqual

static/vuejs/vue.runtime.js:217–232  ·  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

215 * if they are plain objects, do they have the same shape?
216 */
217function 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
234function looseIndexOf (arr, val) {
235 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