unexpected
Advanced tools
Comparing version 2.1.2 to 2.1.3
{ | ||
"name": "unexpected", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"author": "Sune Sloth Simonsen <sune@we-knowhow.dk>", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -14,12 +14,25 @@ (function () { | ||
indexOf: function (arr, o, i) { | ||
if (arr.length === undefined) { | ||
return -1; | ||
indexOf: function (arr, searchElement, fromIndex) { | ||
var length = arr.length >>> 0; // Hack to convert object.length to a UInt32 | ||
fromIndex = +fromIndex || 0; | ||
if (Math.abs(fromIndex) === Infinity) { | ||
fromIndex = 0; | ||
} | ||
for (var j = arr.length, k = k < 0 ? k + j < 0 ? 0 : k + j : k || 0; k < j && arr[k] !== o; k += 1) { | ||
// Looping | ||
if (fromIndex < 0) { | ||
fromIndex += length; | ||
if (fromIndex < 0) { | ||
fromIndex = 0; | ||
} | ||
} | ||
return j <= i ? -1 : i; | ||
for (;fromIndex < length; fromIndex += 1) { | ||
if (arr[fromIndex] === searchElement) { | ||
return fromIndex; | ||
} | ||
} | ||
return -1; | ||
}, | ||
@@ -26,0 +39,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
256859
5043