Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

array-includes

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-includes - npm Package Compare versions

Comparing version 1.1.1 to 2.0.0

4

CHANGELOG.md

@@ -0,1 +1,5 @@

2.0.0 / 2015-05-23
=================
* Fix to not skip holes, per https://github.com/tc39/Array.prototype.includes/issues/15
1.1.1 / 2015-05-23

@@ -2,0 +6,0 @@ =================

2

index.js

@@ -10,3 +10,3 @@ 'use strict';

var fromIndex = arguments.length > 1 ? ES.ToInteger(arguments[1]) : 0;
if (Array.prototype.indexOf && !$isNaN(searchElement) && $isFinite(fromIndex)) {
if (Array.prototype.indexOf && !$isNaN(searchElement) && $isFinite(fromIndex) && typeof searchElement !== 'undefined') {
return Array.prototype.indexOf.apply(this, arguments) > -1;

@@ -13,0 +13,0 @@ }

{
"name": "array-includes",
"version": "1.1.1",
"version": "2.0.0",
"author": "Jordan Harband",

@@ -5,0 +5,0 @@ "description": "A spec-compliant `Array.prototype.includes` shim/polyfill/replacement that works as far down as ES3.",

@@ -7,2 +7,14 @@ module.exports = function (includes, t) {

t.test('simple examples', function (st) {
st.equal(true, includes([1, 2, 3], 1), '[1, 2, 3] includes 1');
st.equal(false, includes([1, 2, 3], 4), '[1, 2, 3] does not include 4');
st.equal(true, includes([NaN], NaN), '[NaN] includes NaN');
st.end();
});
t.test('does not skip holes', function (st) {
st.equal(true, includes(Array(1)), 'Array(1) includes undefined');
st.end();
});
t.test('exceptions', function (et) {

@@ -9,0 +21,0 @@ et.test('fromIndex conversion', function (st) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc