diff --git a/umd/isEq.js b/umd/isEq.js index 9e401c0..83f8ece 100644 --- a/umd/isEq.js +++ b/umd/isEq.js @@ -16,6 +16,11 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol var isEq = function isEq(item1, item2, compareKeys) { + // Simple compare: + // If item1 and item2 are strictly equal, will + // pass all tests regardless of compare keys. + if (item1 === item2) return true; + // Returns false if different types are used. if ((typeof item1 === 'undefined' ? 'undefined' : _typeof(item1)) !== (typeof item2 === 'undefined' ? 'undefined' : _typeof(item2))) return false; @@ -24,7 +29,9 @@ var isEq = function isEq(item1, item2, compareKeys) { if (Array.isArray(item1) && !Array.isArray(item2) || Array.isArray(item2) && !Array.isArray(item1)) return false; // 'NaN's are special. They aren't equal to each other. - if (typeof item1 === 'number') if (isNaN(item1) && isNaN(item2)) return true;else return item1 === item2; + if (typeof item1 === 'number') { + if (isNaN(item1) && isNaN(item2)) return false;else return item1 === item2; + }; // Since types are already equal, let's find if items are equal. if (typeof item1 === 'string' || typeof item1 === 'boolean' || item1 === null || item1 === undefined) { diff --git a/umd/isEq.min.js b/umd/isEq.min.js index ffa850e..01a1a18 100644 --- a/umd/isEq.min.js +++ b/umd/isEq.min.js @@ -1 +1 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.isEq=f()}})(function(){var define,module,exports;return function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o