Socket
Socket
Sign inDemoInstall

is-array-x

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-array-x - npm Package Compare versions

Comparing version 2.0.23 to 2.0.24

47

dist/is-array-x.esm.js

@@ -1,37 +0,24 @@

var _this = this;
function _newArrowCheck(innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } }
import attempt from 'attempt-x';
import toStringTag from 'to-string-tag-x';
var nativeIsArray = [].isArray;
var isArrayNative = typeof nativeIsArray === 'function' && nativeIsArray;
var testRes = isArrayNative && attempt(function () {
_newArrowCheck(this, _this);
return isArrayNative([]) === true && isArrayNative({
var nia = [].isArray;
var nativeIsArray = typeof nia === 'function' && nia;
var testResult = attempt(function attemptee() {
return nativeIsArray([]) === true && nativeIsArray({
length: 0
}) === false;
}.bind(this));
});
var isWorking = testResult.threw === false && testResult.value === true;
export var implementation = function isArray(value) {
return toStringTag(value) === '[object Array]';
};
/**
* Determines whether the passed value is an Array.
*
* @param {*} value - The value to test.
* @returns {boolean} - True if an array; otherwise false.
*/
var isArrayFn = function iife() {
if (testRes && testRes.threw === false && testRes.value === true) {
return isArrayNative;
}
/**
* The isArray() function determines whether the passed value is an Array.
*
* @function isArray
* @param {*} [value] - The object to be checked..
* @returns {boolean} `true` if the object is an Array; otherwise, `false`.
*/
var isArray = isWorking ? nativeIsArray : implementation;
export default isArray;
return function isArray(value) {
return toStringTag(value) === '[object Array]';
};
}();
export default isArrayFn;
//# sourceMappingURL=is-array-x.esm.js.map

@@ -5,9 +5,9 @@ /*!

"copywrite": "Copyright (c) 2017-present",
"date": "2019-07-31T22:18:31.532Z",
"date": "2019-08-05T21:14:40.813Z",
"describe": "",
"description": "Determines whether the passed value is an Array.",
"file": "is-array-x.js",
"hash": "85ece551f682f42a388f",
"hash": "54be4328fe94e0152ade",
"license": "MIT",
"version": "2.0.23"
"version": "2.0.24"
}

@@ -193,40 +193,28 @@ */

// CONCATENATED MODULE: ./dist/is-array-x.esm.js
var _this = undefined;
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "implementation", function() { return implementation; });
function _newArrowCheck(innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } }
var nativeIsArray = [].isArray;
var isArrayNative = typeof nativeIsArray === 'function' && nativeIsArray;
var testRes = isArrayNative && attempt_x_esm(function () {
_newArrowCheck(this, _this);
return isArrayNative([]) === true && isArrayNative({
var nia = [].isArray;
var nativeIsArray = typeof nia === 'function' && nia;
var testResult = attempt_x_esm(function attemptee() {
return nativeIsArray([]) === true && nativeIsArray({
length: 0
}) === false;
}.bind(undefined));
});
var isWorking = testResult.threw === false && testResult.value === true;
var implementation = function isArray(value) {
return to_string_tag_x_esm(value) === '[object Array]';
};
/**
* Determines whether the passed value is an Array.
*
* @param {*} value - The value to test.
* @returns {boolean} - True if an array; otherwise false.
*/
var isArrayFn = function iife() {
if (testRes && testRes.threw === false && testRes.value === true) {
return isArrayNative;
}
/**
* The isArray() function determines whether the passed value is an Array.
*
* @function isArray
* @param {*} [value] - The object to be checked..
* @returns {boolean} `true` if the object is an Array; otherwise, `false`.
*/
var is_array_x_esm_isArray = isWorking ? nativeIsArray : implementation;
/* harmony default export */ var is_array_x_esm = __webpack_exports__["default"] = (is_array_x_esm_isArray);
return function isArray(value) {
return to_string_tag_x_esm(value) === '[object Array]';
};
}();
/* harmony default export */ var is_array_x_esm = __webpack_exports__["default"] = (isArrayFn);
/***/ })

@@ -233,0 +221,0 @@ /******/ ]);

@@ -5,12 +5,12 @@ /*!

"copywrite": "Copyright (c) 2017-present",
"date": "2019-07-31T22:18:31.532Z",
"date": "2019-08-05T21:14:40.813Z",
"describe": "",
"description": "Determines whether the passed value is an Array.",
"file": "is-array-x.min.js",
"hash": "430df2500f175690d3be",
"hash": "1facdf1f3208307f21b4",
"license": "MIT",
"version": "2.0.23"
"version": "2.0.24"
}
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.isArrayX=t():e.isArrayX=t()}(function(){"use strict";return"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:Function("return this")()}(),function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);var r={}.toString,o=function(e){return null===e?"[object Null]":void 0===e?"[object Undefined]":r.call(e)};var u=[].isArray,i="function"==typeof u&&u,f=i&&function(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return{threw:!1,value:e.apply(this,n)}}catch(e){return{threw:!0,value:e}}}(function(){return function(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}(this,void 0),!0===i([])&&!1===i({length:0})}.bind(void 0)),c=f&&!1===f.threw&&!0===f.value?i:function(e){return"[object Array]"===o(e)};t.default=c}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.isArrayX=t():e.isArrayX=t()}(function(){"use strict";return"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:Function("return this")()}(),function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);var r=function(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return{threw:!1,value:e.apply(this,n)}}catch(e){return{threw:!0,value:e}}},o={}.toString,u=function(e){return null===e?"[object Null]":void 0===e?"[object Undefined]":o.call(e)};n.d(t,"implementation",function(){return a});var i=[].isArray,f="function"==typeof i&&i,l=r(function(){return!0===f([])&&!1===f({length:0})}),c=!1===l.threw&&!0===l.value,a=function(e){return"[object Array]"===u(e)},d=c?f:a;t.default=d}])});
//# sourceMappingURL=is-array-x.min.js.map
{
"name": "is-array-x",
"version": "2.0.23",
"version": "2.0.24",
"description": "Determines whether the passed value is an Array.",

@@ -65,3 +65,3 @@ "homepage": "https://github.com/Xotic750/is-array-x",

"@types/jest": "^24.0.16",
"@types/node": "^12.6.8",
"@types/node": "^12.6.9",
"@xotic750/eslint-config-recommended": "^1.0.5",

@@ -107,3 +107,3 @@ "babel-core": "^7.0.0-0",

"typescript": "^3.5.3",
"webpack": "^4.38.0",
"webpack": "^4.39.1",
"webpack-bundle-analyzer": "^3.4.1",

@@ -110,0 +110,0 @@ "webpack-cli": "^3.3.6",

import attempt from 'attempt-x';
import toStringTag from 'to-string-tag-x';
const nativeIsArray = [].isArray;
const isArrayNative = typeof nativeIsArray === 'function' && nativeIsArray;
const nia = [].isArray;
const nativeIsArray = typeof nia === 'function' && nia;
const testRes =
isArrayNative &&
attempt(() => {
return isArrayNative([]) === true && isArrayNative({length: 0}) === false;
});
const testResult = attempt(function attemptee() {
return nativeIsArray([]) === true && nativeIsArray({length: 0}) === false;
});
const isArrayFn = (function iife() {
if (testRes && testRes.threw === false && testRes.value === true) {
return isArrayNative;
}
const isWorking = testResult.threw === false && testResult.value === true;
/**
* The isArray() function determines whether the passed value is an Array.
*
* @function isArray
* @param {*} [value] - The object to be checked..
* @returns {boolean} `true` if the object is an Array; otherwise, `false`.
*/
return function isArray(value) {
return toStringTag(value) === '[object Array]';
};
})();
export const implementation = function isArray(value) {
return toStringTag(value) === '[object Array]';
};
export default isArrayFn;
/**
* Determines whether the passed value is an Array.
*
* @param {*} value - The value to test.
* @returns {boolean} - True if an array; otherwise false.
*/
const isArray = isWorking ? nativeIsArray : implementation;
export default isArray;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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