Function: equalPoints

Compares all mxPoints in the given lists.

Parameters:

a - Array of <mxPoints> to be compared.
b - Array of <mxPoints> to be compared.
348444
function(a, b)
	{
		if ((a == null && b != null) || (a != null && b == null) ||
			(a != null && b != null && a.length != b.length))
		{
			return false;
		}
		else if (a != null && b != null)
		{
			for (var i = 0; i < a.length; i++)
			{
				if (a[i] == b[i] || (a[i] != null && !a[i].equals(b[i])))
				{
					return false;
				}
			}
		}
		
		return true;
	}
702348
function objectEqual(a, b, m) {
  if (!isValue(a) || !isValue(b)) {
    return false;
  }

  if (a.prototype !== b.prototype) {
    return false;
  }

  var i;
  if (m) {
    for (i = 0; i < m.length; i++) {
      if ((m[i][0] === a && m[i][1] === b)
      ||  (m[i][0] === b && m[i][1] === a)) {
        return true;
      }
    }
  } else {
    m = [];
  }

  try {
    var ka = enumerable(a);
    var kb = enumerable(b);
  } catch (ex) {
    return false;
  }

  ka.sort();
  kb.sort();

  if (!iterableEqual(ka, kb)) {
    return false;
  }

  m.push([ a, b ]);

  var key;
  for (i = ka.length - 1; i >= 0; i--) {
    key = ka[i];
    if (!deepEqual(a[key], b[key], m)) {
      return false;
    }
  }

  return true;
}
229561
function throwEqualError( F, a, b ) {
		if ( (F[a] || F[b]) && (F[a] === F[b]) ) {
			throw new Error(a);
		}
	}
504182
function equalSimpleArrays(arr1, arr2) {

	if (arr1 && (arr1.length > 0))
		return (
			arr2 &&
				(arr2.length === arr1.length) &&
				arr2.every((v, i) => (v === arr1[i]))
		);

	return (!arr2 || (arr2.length === 0));
}
621057
function isEqualWith (obj1, obj2, func) {
  if (isFunction(func)) {
    return equalCompare(obj1, obj2, function (v1, v2, key, obj1, obj2) {
      var result = func(v1, v2, key, obj1, obj2)
      return isUndefined(result) ? defaultCompare(v1, v2) : !!result
    }, func)
  }
  return equalCompare(obj1, obj2, defaultCompare)
}
876338
function similar(a,b) {
    if(a instanceof Array) {
        if(!(b instanceof Array))
            return false

        var tenPercent = a.length/10
        var notEqual = Math.abs(a.length-b.length) // initialize with the length difference
        for(var n=0; n<a.length; n++) {
            if(equal(a[n],b[n])) {
                if(notEqual >= 2 && notEqual > tenPercent || notEqual === a.length) {
                    return false
                }

                notEqual++
            }
        }
        // else
        return true

    } else if(a instanceof Object) {
        if(!(b instanceof Object))
            return false

        var keyMap = merge(arrayToMap(Object.keys(a)), arrayToMap(Object.keys(b)))
        var keyLength = Object.keys(keyMap).length
        var tenPercent = keyLength / 10
        var notEqual = 0
        for(var key in keyMap) {
            var aVal = a[key]
            var bVal = b[key]

            if(!equal(aVal,bVal)) {
                if(notEqual >= 2 && notEqual > tenPercent || notEqual+1 === keyLength) {
                    return false
                }

                notEqual++
            }
        }
        // else
        return true

    } else {
        return a===b || Number.isNaN(a) && Number.isNaN(b)
    }
}
1346723
function (comparatorArray) {
  return function (a, b) {
    for (var i = 0; i < comparatorArray.length; ++i) {
      var compare = comparatorArray[i](a, b);
      if (compare !== 0)
        return compare;
    }
    return 0;
  };
}
407099
function compareObjects (x, y) {
    const keysX = Object.keys(x)
    const keysY = Object.keys(y)

    // compare keys
    keysX.sort(naturalSort)
    keysY.sort(naturalSort)
    const c = compareArrays(keysX, keysY)
    if (c !== 0) {
      return c
    }

    // compare values
    for (let i = 0; i < keysX.length; i++) {
      const v = compareNatural(x[keysX[i]], y[keysY[i]])
      if (v !== 0) {
        return v
      }
    }

    return 0
  }
24638
function sort_mx (mx_list) {
    const sorted = mx_list.sort((a,b) => a.priority - b.priority);

    // This isn't a very good shuffle but it'll do for now.
    for (let i=0,l=sorted.length-1; i<l; i++) {
        if (sorted[i].priority === sorted[i+1].priority) {
            if (Math.round(Math.random())) { // 0 or 1
                const j = sorted[i];
                sorted[i] = sorted[i+1];
                sorted[i+1] = j;
            }
        }
    }
    return sorted;
}
1348224
function equal(a, b, diff) {
  diff = diff || {};
  if (a.type !== b.type) {
    return equalDiff(a, b, diff);
  }
  if (a.value !== b.value) {
    return equalDiff(a, b, diff);
  }
  if (isValueNode(a) !== isValueNode(b)) {
    return equalDiff(a, b, diff);
  }
  if (!isValueNode(a)) {
    if (a.nodes.length !== b.nodes.length) {
      return equalDiff(a, b, diff);
    }
    for (var i = 0; i < b.nodes.length; i++) {
      if (!equal(a.nodes[i], b.nodes[i], diff)) {
        return false;
      }
    }
  }
  return true;
}
222128
protected boolean arraysEqual(Object[] a1, Object[] a2) {
		if (a1 != null && a2 != null && a1.length == a2.length) {
			// Loop over each element and compare them using our comparator
			for (int i = 0; i < a1.length; i++) {
				if (!equalByComparator(a1[i], a2[i])) {
					return false;
				}
			}
			return true;
		}
		else if (a1 == null && a2 == null) {
			return true;
		}
		return false;
	}
869212
function argumentsEqual(a, b, m) {
  if ('arguments' !== type(b)) return false;
  a = [].slice.call(a);
  b = [].slice.call(b);
  return deepEqual(a, b, m);
}
1345663
function compare(a, b) {
    if (Type.isString(a)) {
        return a === b;
    } else if (Type.isNumber(a)) {
        if (isNaN(a) || isNaN(b)) {
            return isNaN(a) === isNaN(b);
        }
        return a === b;
    } else if (Type.isBoolean(a)) {
        return a === b;
    } else if (Type.isDate(a) && Type.isDate(b)) {
        return a.getTime() === b.getTime();
    } else if (Type.isRegExp(a) && Type.isRegExp(b)) {
        return a.source === b.source;
    } else if (Type.isArray(a) && Type.isArray(b)) {
        // check references first
        if (a === b) {
            return true;
        }
        return a.every(function (item, index) {
            try {
                return compare(item, b[index]);
            } catch (e) {
                throw e;
            }
        });
    } else if (Type.isObject(a) && Type.isObject(b)) {
        var equal = [];
        // check references first
        if (a === b) {
            return true;
        }

        try {
            for (var key in a) {
                equal.push(compare(a[key], b[key]));
            }
        } catch (e) {
            throw e;
        }
        return equal.every(function (item) {
            return item === true;
        });
        /// compare undefined and nulls and nans
    } else if (a === b) {
        return true;
    }

    return false;
}
486892
function compare(a, b) {
  let isIdentical = true;

  if (isObject(a) && isObject(b)) {
    if (Object.keys(a).length !== Object.keys(b).length) {
      return false;
    }
    Object.keys(a).forEach((key) => {
      if (!compare(a[key], b[key])) {
        isIdentical = false;
      }
    });
    return isIdentical;
  } if (isArray(a) && isArray(b)) {
    if (a.length !== b.length) {
      return false;
    }
    for (let i = 0, l = a.length; i < l; i += 1) {
      if (!compare(a[i], b[i])) {
        return false;
      }
    }
    return true;
  }
  return a === b;
}
925981
function looseEqual (a, b) {
	  /* eslint-disable eqeqeq */
	  return a == b || (
	    isObject(a) && isObject(b)
	      ? JSON.stringify(a) === JSON.stringify(b)
	      : false
	  )
	  /* eslint-enable eqeqeq */
	}
698152
function(a0, a1) {
		var i, ilen, v0, v1;

		if (!a0 || !a1 || a0.length !== a1.length) {
			return false;
		}

		for (i = 0, ilen = a0.length; i < ilen; ++i) {
			v0 = a0[i];
			v1 = a1[i];

			if (v0 instanceof Array && v1 instanceof Array) {
				if (!helpers.arrayEquals(v0, v1)) {
					return false;
				}
			} else if (v0 !== v1) {
				// NOTE: two different object instances will never be equal: {x:20} != {x:20}
				return false;
			}
		}

		return true;
	}
1094018
function points_eq(a,b,precision){
    return scalar_eq(a[0],b[0],precision) && scalar_eq(a[1],b[1],precision);
}