is-array-like-x
Advanced tools
Comparing version 1.0.13 to 1.1.0
21
index.js
@@ -42,3 +42,3 @@ /** | ||
* | ||
* @version 1.0.13 | ||
* @version 1.1.0 | ||
* @author Xotic750 <Xotic750@gmail.com> | ||
@@ -50,13 +50,16 @@ * @copyright Xotic750 | ||
/*jslint maxlen:80, es6:false, white:true */ | ||
/* jslint maxlen:80, es6:true, white:true */ | ||
/*jshint bitwise:true, camelcase:true, curly:true, eqeqeq:true, forin:true, | ||
freeze:true, futurehostile:true, latedef:true, newcap:true, nocomma:true, | ||
nonbsp:true, singleGroups:true, strict:true, undef:true, unused:true, | ||
es3:true, esnext:false, plusplus:true, maxparams:1, maxdepth:1, | ||
maxstatements:4, maxcomplexity:1 */ | ||
/* jshint bitwise:true, camelcase:true, curly:true, eqeqeq:true, forin:true, | ||
freeze:true, futurehostile:true, latedef:true, newcap:true, nocomma:true, | ||
nonbsp:true, singleGroups:true, strict:true, undef:true, unused:true, | ||
es3:true, esnext:true, plusplus:true, maxparams:2, maxdepth:1, | ||
maxstatements:2, maxcomplexity:2 */ | ||
/*global module */ | ||
/* eslint strict: 1, max-statements: 1 */ | ||
;(function () { | ||
/* global module */ | ||
;(function () { // eslint-disable-line no-extra-semi | ||
'use strict'; | ||
@@ -63,0 +66,0 @@ |
@@ -43,3 +43,3 @@ (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.returnExports = f()}})(function(){var define,module,exports;return (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<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){ | ||
* | ||
* @version 1.0.13 | ||
* @version 1.1.0 | ||
* @author Xotic750 <Xotic750@gmail.com> | ||
@@ -51,13 +51,16 @@ * @copyright Xotic750 | ||
/*jslint maxlen:80, es6:false, white:true */ | ||
/* jslint maxlen:80, es6:true, white:true */ | ||
/*jshint bitwise:true, camelcase:true, curly:true, eqeqeq:true, forin:true, | ||
freeze:true, futurehostile:true, latedef:true, newcap:true, nocomma:true, | ||
nonbsp:true, singleGroups:true, strict:true, undef:true, unused:true, | ||
es3:true, esnext:false, plusplus:true, maxparams:1, maxdepth:1, | ||
maxstatements:4, maxcomplexity:1 */ | ||
/* jshint bitwise:true, camelcase:true, curly:true, eqeqeq:true, forin:true, | ||
freeze:true, futurehostile:true, latedef:true, newcap:true, nocomma:true, | ||
nonbsp:true, singleGroups:true, strict:true, undef:true, unused:true, | ||
es3:true, esnext:true, plusplus:true, maxparams:2, maxdepth:1, | ||
maxstatements:2, maxcomplexity:2 */ | ||
/*global module */ | ||
/* eslint strict: 1, max-statements: 1 */ | ||
;(function () { | ||
/* global module */ | ||
;(function () { // eslint-disable-line no-extra-semi | ||
'use strict'; | ||
@@ -134,3 +137,3 @@ | ||
* | ||
* @version 1.0.11 | ||
* @version 1.1.0 | ||
* @author Xotic750 <Xotic750@gmail.com> | ||
@@ -142,13 +145,16 @@ * @copyright Xotic750 | ||
/*jslint maxlen:80, es6:true, white:true */ | ||
/* jslint maxlen:80, es6:true, white:true */ | ||
/*jshint bitwise:true, camelcase:true, curly:true, eqeqeq:true, forin:true, | ||
freeze:true, futurehostile:true, latedef:true, newcap:true, nocomma:true, | ||
nonbsp:true, singleGroups:true, strict:true, undef:true, unused:true, | ||
es3:false, esnext:true, plusplus:true, maxparams:1, maxdepth:1, | ||
maxstatements:1, maxcomplexity:1 */ | ||
/* jshint bitwise:true, camelcase:true, curly:true, eqeqeq:true, forin:true, | ||
freeze:true, futurehostile:true, latedef:true, newcap:true, nocomma:true, | ||
nonbsp:true, singleGroups:true, strict:true, undef:true, unused:true, | ||
es3:false, esnext:true, plusplus:true, maxparams:1, maxdepth:1, | ||
maxstatements:3, maxcomplexity:2 */ | ||
/*global module */ | ||
/* eslint strict: 1, max-statements: 1, symbol-description: 1 */ | ||
;(function () { | ||
/* global module */ | ||
;(function () { // eslint-disable-line no-extra-semi | ||
'use strict'; | ||
@@ -209,3 +215,3 @@ | ||
* | ||
* @version 1.0.10 | ||
* @version 1.1.0 | ||
* @author Xotic750 <Xotic750@gmail.com> | ||
@@ -217,13 +223,16 @@ * @copyright Xotic750 | ||
/*jslint maxlen:80, es6:true, white:true */ | ||
/* jslint maxlen:80, es6:true, white:true */ | ||
/*jshint bitwise:true, camelcase:true, curly:true, eqeqeq:true, forin:true, | ||
freeze:true, futurehostile:true, latedef:true, newcap:true, nocomma:true, | ||
nonbsp:true, singleGroups:true, strict:true, undef:true, unused:true, | ||
es3:false, esnext:true, plusplus:true, maxparams:1, maxdepth:1, | ||
maxstatements:1, maxcomplexity:1 */ | ||
/* jshint bitwise:true, camelcase:true, curly:true, eqeqeq:true, forin:true, | ||
freeze:true, futurehostile:true, latedef:true, newcap:true, nocomma:true, | ||
nonbsp:true, singleGroups:true, strict:true, undef:true, unused:true, | ||
es3:false, esnext:true, plusplus:true, maxparams:1, maxdepth:1, | ||
maxstatements:3, maxcomplexity:2 */ | ||
/*global module */ | ||
/* eslint strict: 1, max-statements: 1 */ | ||
;(function () { | ||
/* global module */ | ||
;(function () { // eslint-disable-line no-extra-semi | ||
'use strict'; | ||
@@ -237,4 +246,3 @@ | ||
*/ | ||
module.exports = _dereq_('has-symbol-support-x') && | ||
typeof Symbol.toStringTag === 'symbol'; | ||
module.exports = _dereq_('has-symbol-support-x') && typeof Symbol.toStringTag === 'symbol'; | ||
}()); | ||
@@ -286,3 +294,3 @@ | ||
* | ||
* @version 1.0.6 | ||
* @version 1.1.0 | ||
* @author Xotic750 <Xotic750@gmail.com> | ||
@@ -294,13 +302,16 @@ * @copyright Xotic750 | ||
/*jslint maxlen:80, es6:false, white:true */ | ||
/* jslint maxlen:80, es6:true, white:true */ | ||
/*jshint bitwise:true, camelcase:true, curly:true, eqeqeq:true, forin:true, | ||
freeze:true, futurehostile:true, latedef:true, newcap:true, nocomma:true, | ||
nonbsp:true, singleGroups:true, strict:true, undef:true, unused:true, | ||
es3:true, esnext:false, plusplus:true, maxparams:1, maxdepth:1, | ||
maxstatements:8, maxcomplexity:4 */ | ||
/* jshint bitwise:true, camelcase:true, curly:true, eqeqeq:true, forin:true, | ||
freeze:true, futurehostile:true, latedef:true, newcap:true, nocomma:true, | ||
nonbsp:true, singleGroups:true, strict:true, undef:true, unused:true, | ||
es3:false, esnext:true, plusplus:true, maxparams:1, maxdepth:1, | ||
maxstatements:3, maxcomplexity:2 */ | ||
/*global module */ | ||
/* eslint strict: 1, max-statements: 1 */ | ||
;(function () { | ||
/* global module */ | ||
;(function () { // eslint-disable-line no-extra-semi | ||
'use strict'; | ||
@@ -323,3 +334,3 @@ | ||
*/ | ||
function tryFunctionObject(value) { | ||
var tryFunctionObject = function (value) { | ||
try { | ||
@@ -330,3 +341,3 @@ fToString.call(value); | ||
return false; | ||
} | ||
}; | ||
@@ -408,3 +419,3 @@ /** | ||
* | ||
* @version 1.0.10 | ||
* @version 1.1.0 | ||
* @author Xotic750 <Xotic750@gmail.com> | ||
@@ -416,13 +427,16 @@ * @copyright Xotic750 | ||
/*jslint maxlen:80, es6:false, white:true */ | ||
/* jslint maxlen:80, es6:true, white:true */ | ||
/*jshint bitwise:true, camelcase:true, curly:true, eqeqeq:true, forin:true, | ||
freeze:true, futurehostile:true, latedef:true, newcap:true, nocomma:true, | ||
nonbsp:true, singleGroups:true, strict:true, undef:true, unused:true, | ||
es3:true, esnext:false, plusplus:true, maxparams:1, maxdepth:1, | ||
maxstatements:3, maxcomplexity:2 */ | ||
/* jshint bitwise:true, camelcase:true, curly:true, eqeqeq:true, forin:true, | ||
freeze:true, futurehostile:true, latedef:true, newcap:true, nocomma:true, | ||
nonbsp:true, singleGroups:true, strict:true, undef:true, unused:true, | ||
es3:false, esnext:true, plusplus:true, maxparams:1, maxdepth:1, | ||
maxstatements:3, maxcomplexity:2 */ | ||
/*global module */ | ||
/* eslint strict: 1, max-statements: 1 */ | ||
;(function () { | ||
/* global module */ | ||
;(function () { // eslint-disable-line no-extra-semi | ||
'use strict'; | ||
@@ -471,3 +485,3 @@ | ||
/** | ||
* lodash 4.0.0 (Custom Build) <https://lodash.com/> | ||
* lodash 4.0.1 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modularize exports="npm" -o ./` | ||
@@ -508,3 +522,4 @@ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> | ||
function isLength(value) { | ||
return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; | ||
return typeof value == 'number' && | ||
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; | ||
} | ||
@@ -601,3 +616,3 @@ | ||
* | ||
* @version 1.0.11 | ||
* @version 1.1.0 | ||
* @author Xotic750 <Xotic750@gmail.com> | ||
@@ -609,13 +624,16 @@ * @copyright Xotic750 | ||
/*jslint maxlen:80, es6:false, white:true */ | ||
/* jslint maxlen:80, es6:true, white:true */ | ||
/*jshint bitwise:true, camelcase:true, curly:true, eqeqeq:true, forin:true, | ||
freeze:true, futurehostile:true, latedef:true, newcap:true, nocomma:true, | ||
nonbsp:true, singleGroups:true, strict:true, undef:true, unused:true, | ||
es3:true, esnext:false, plusplus:true, maxparams:1, maxdepth:1, | ||
maxstatements:6, maxcomplexity:3 */ | ||
/* jshint bitwise:true, camelcase:true, curly:true, eqeqeq:true, forin:true, | ||
freeze:true, futurehostile:true, latedef:true, newcap:true, nocomma:true, | ||
nonbsp:true, singleGroups:true, strict:true, undef:true, unused:true, | ||
es3:false, esnext:true, plusplus:true, maxparams:1, maxdepth:1, | ||
maxstatements:3, maxcomplexity:2 */ | ||
/*global module */ | ||
/* eslint strict: 1, max-statements: 1 */ | ||
;(function () { | ||
/* global module */ | ||
;(function () { // eslint-disable-line no-extra-semi | ||
'use strict'; | ||
@@ -622,0 +640,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.returnExports=t()}}(function(){return function e(t,n,i){function s(r,u){if(!n[r]){if(!t[r]){var f="function"==typeof require&&require;if(!u&&f)return f(r,!0);if(o)return o(r,!0);var c=new Error("Cannot find module '"+r+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[r]={exports:{}};t[r][0].call(l.exports,function(n){var e=t[r][1][n];return s(e?e:n)},l,l.exports,e,t,n,i)}return n[r].exports}for(var o="function"==typeof require&&require,r=0;r<i.length;r++)s(i[r]);return s}({1:[function(t,n,e){!function(){"use strict";var e=t("is-nil-x"),i=t("is-function-x"),o=t("lodash.islength");n.exports=function isArrayLike(t){return!e(t)&&!i(t)&&o(t.length)}}()},{"is-function-x":4,"is-nil-x":5,"lodash.islength":7}],2:[function(t,n,e){!function(){"use strict";n.exports="function"==typeof Symbol&&"symbol"==typeof Symbol()}()},{}],3:[function(t,n,e){!function(){"use strict";n.exports=t("has-symbol-support-x")&&"symbol"==typeof Symbol.toStringTag}()},{"has-symbol-support-x":2}],4:[function(t,n,e){!function(){"use strict";function tryFunctionObject(t){try{return e.call(t),!0}catch(n){}return!1}var e=Function.prototype.toString,i=t("to-string-tag-x"),o=t("has-to-string-tag-x"),r=t("is-primitive"),u="[object Function]",s="[object GeneratorFunction]";n.exports=function isFunction(t){if(r(t))return!1;if(o)return tryFunctionObject(t);var n=i(t);return n===u||n===s}}()},{"has-to-string-tag-x":3,"is-primitive":6,"to-string-tag-x":9}],5:[function(t,n,e){!function(){"use strict";var e=t("validate.io-undefined"),i=t("lodash.isnull");n.exports=function isNil(t){return i(t)||e(t)}}()},{"lodash.isnull":8,"validate.io-undefined":10}],6:[function(t,n,e){"use strict";n.exports=function isPrimitive(t){return null==t||"function"!=typeof t&&"object"!=typeof t}},{}],7:[function(t,n,e){function isLength(t){return"number"==typeof t&&t>-1&&t%1==0&&i>=t}var i=9007199254740991;n.exports=isLength},{}],8:[function(t,n,e){function isNull(t){return null===t}n.exports=isNull},{}],9:[function(t,n,e){!function(){"use strict";var e=Object.prototype.toString,i=t("lodash.isnull"),o=t("validate.io-undefined"),r="[object Null]",u="[object Undefined]";n.exports=function toStringTag(t){return i(t)?r:o(t)?u:e.call(t)}}()},{"lodash.isnull":8,"validate.io-undefined":10}],10:[function(t,n,e){"use strict";function isUndefined(t){return void 0===t}n.exports=isUndefined},{}]},{},[1])(1)}); | ||
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.returnExports=t()}}(function(){return function e(t,n,i){function s(r,u){if(!n[r]){if(!t[r]){var f="function"==typeof require&&require;if(!u&&f)return f(r,!0);if(o)return o(r,!0);var c=new Error("Cannot find module '"+r+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[r]={exports:{}};t[r][0].call(l.exports,function(n){var e=t[r][1][n];return s(e?e:n)},l,l.exports,e,t,n,i)}return n[r].exports}for(var o="function"==typeof require&&require,r=0;r<i.length;r++)s(i[r]);return s}({1:[function(t,n,e){!function(){"use strict";var e=t("is-nil-x"),i=t("is-function-x"),o=t("lodash.islength");n.exports=function isArrayLike(t){return!e(t)&&!i(t)&&o(t.length)}}()},{"is-function-x":4,"is-nil-x":5,"lodash.islength":7}],2:[function(t,n,e){!function(){"use strict";n.exports="function"==typeof Symbol&&"symbol"==typeof Symbol()}()},{}],3:[function(t,n,e){!function(){"use strict";n.exports=t("has-symbol-support-x")&&"symbol"==typeof Symbol.toStringTag}()},{"has-symbol-support-x":2}],4:[function(t,n,e){!function(){"use strict";var e=Function.prototype.toString,i=t("to-string-tag-x"),o=t("has-to-string-tag-x"),r=t("is-primitive"),u=function(t){try{return e.call(t),!0}catch(t){}return!1};n.exports=function isFunction(t){if(r(t))return!1;if(o)return u(t);var n=i(t);return"[object Function]"===n||"[object GeneratorFunction]"===n}}()},{"has-to-string-tag-x":3,"is-primitive":6,"to-string-tag-x":9}],5:[function(t,n,e){!function(){"use strict";var e=t("validate.io-undefined"),i=t("lodash.isnull");n.exports=function isNil(t){return i(t)||e(t)}}()},{"lodash.isnull":8,"validate.io-undefined":10}],6:[function(t,n,e){"use strict";n.exports=function isPrimitive(t){return null==t||"function"!=typeof t&&"object"!=typeof t}},{}],7:[function(t,n,e){function isLength(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=i}var i=9007199254740991;n.exports=isLength},{}],8:[function(t,n,e){function isNull(t){return null===t}n.exports=isNull},{}],9:[function(t,n,e){!function(){"use strict";var e=Object.prototype.toString,i=t("lodash.isnull"),o=t("validate.io-undefined");n.exports=function toStringTag(t){return i(t)?"[object Null]":o(t)?"[object Undefined]":e.call(t)}}()},{"lodash.isnull":8,"validate.io-undefined":10}],10:[function(t,n,e){"use strict";function isUndefined(t){return void 0===t}n.exports=isUndefined},{}]},{},[1])(1)}); | ||
//# sourceMappingURL=lib/is-array-like-x.map |
{ | ||
"name": "is-array-like-x", | ||
"version": "1.0.13", | ||
"version": "1.1.0", | ||
"description": "ES6 isArrayLike module.", | ||
@@ -10,3 +10,3 @@ "homepage": "https://github.com/Xotic750/is-array-like-x", | ||
}, | ||
"copyright": "Copyright (c) 2015-2016", | ||
"copyright": "Copyright (c) 2015-2017", | ||
"keywords": [ | ||
@@ -33,17 +33,21 @@ "es6", | ||
"dependencies": { | ||
"is-nil-x": "^1.0.10", | ||
"is-function-x": "^1.0.6", | ||
"lodash.islength": "^4.0.0" | ||
"is-nil-x": "^1.1.0", | ||
"is-function-x": "^1.1.0", | ||
"lodash.islength": "^4.0.1" | ||
}, | ||
"devDependencies": { | ||
"es5-shim": "^4.5.4", | ||
"es6-shim": "^0.34.4", | ||
"@ljharb/eslint-config": "^11.0.0", | ||
"es5-shim": "^4.5.9", | ||
"es6-shim": "^0.35.3", | ||
"es7-shim": "^6.0.0", | ||
"eslint": "^3.17.1", | ||
"eslint-plugin-import": "^2.2.0", | ||
"json3": "^3.3.2", | ||
"jscs": "^2.9.0", | ||
"uglify-js": "^2.6.1", | ||
"browserify": "^13.0.0", | ||
"jscs": "^3.0.7", | ||
"uglify-js": "^2.8.11", | ||
"browserify": "^14.1.0", | ||
"browserify-derequire": "^0.9.4", | ||
"jasmine-node": "^1.14.5", | ||
"jsdoc-to-markdown": "^1.3.3", | ||
"nsp": "^2.2.0" | ||
"jsdoc-to-markdown": "^3.0.0", | ||
"nsp": "^2.6.3" | ||
}, | ||
@@ -54,2 +58,3 @@ "scripts": { | ||
"style": "jscs index.js", | ||
"eslint": "eslint *.js tests/spec/*.js", | ||
"docs": "jsdoc2md --name-format --example-lang js index.js > README.md", | ||
@@ -56,0 +61,0 @@ "build": "browserify -p browserify-derequire -e index.js -o lib/is-array-like-x.js -u 'crypto' -s returnExports", |
<a name="module_is-array-like-x"></a> | ||
## is-array-like-x | ||
@@ -42,7 +43,8 @@ <a href="https://travis-ci.org/Xotic750/is-array-like-x" | ||
**Version**: 1.0.13 | ||
**Author:** Xotic750 <Xotic750@gmail.com> | ||
**Version**: 1.1.0 | ||
**Author**: Xotic750 <Xotic750@gmail.com> | ||
**License**: [MIT](<https://opensource.org/licenses/MIT>) | ||
**Copyright**: Xotic750 | ||
<a name="exp_module_is-array-like-x--module.exports"></a> | ||
### `module.exports(value)` ⇒ <code>boolean</code> ⏏ | ||
@@ -49,0 +51,0 @@ Checks if value is array-like. A value is considered array-like if it's |
@@ -1,12 +0,16 @@ | ||
/*jslint maxlen:80, es6:false, white:true */ | ||
/* jslint maxlen:80, es6:true, white:true */ | ||
/*jshint bitwise:true, camelcase:true, curly:true, eqeqeq:true, forin:true, | ||
freeze:true, futurehostile:true, latedef:true, newcap:true, nocomma:true, | ||
nonbsp:true, singleGroups:true, strict:true, undef:true, unused:true, | ||
es3:true, esnext:false, plusplus:true, maxparams:2, maxdepth:2, | ||
maxstatements:23, maxcomplexity:4 */ | ||
/* jshint bitwise:true, camelcase:true, curly:true, eqeqeq:true, forin:true, | ||
freeze:true, futurehostile:true, latedef:true, newcap:true, nocomma:true, | ||
nonbsp:true, singleGroups:true, strict:true, undef:true, unused:true, | ||
es3:true, esnext:true, plusplus:true, maxparams:1, maxdepth:2, | ||
maxstatements:11, maxcomplexity:3 */ | ||
/*global JSON:true, expect, module, require, describe, it, returnExports */ | ||
/* eslint strict: 1, max-lines: 1, symbol-description: 1, max-nested-callbacks: 1, | ||
max-statements: 1, no-sparse-arrays: 1, no-new-func: 1 */ | ||
(function () { | ||
/* global JSON:true, expect, module, require, describe, it, returnExports */ | ||
;(function () { // eslint-disable-line no-extra-semi | ||
'use strict'; | ||
@@ -23,2 +27,9 @@ | ||
require('es6-shim'); | ||
var es7 = require('es7-shim'); | ||
Object.keys(es7).forEach(function (key) { | ||
var obj = es7[key]; | ||
if (typeof obj.shim === 'function') { | ||
obj.shim(); | ||
} | ||
}); | ||
isArrayLike = require('../../index.js'); | ||
@@ -32,7 +43,7 @@ } else { | ||
(function () { | ||
var values = [arguments, [1, 2, 3], { '0': 1, 'length': 1 }, 'a'], | ||
expected = values.map(function () { | ||
return true; | ||
}), | ||
actual = values.map(isArrayLike); | ||
var values = [arguments, [1, 2, 3], { 0: 1, length: 1 }, 'a'], | ||
expected = values.map(function () { | ||
return true; | ||
}), | ||
actual = values.map(isArrayLike); | ||
expect(actual).toEqual(expected); | ||
@@ -43,16 +54,18 @@ }(1, 2, 3)); | ||
it('should return `false` for non-arrays', function () { | ||
/*jshint elision:true */ | ||
var falsey = [, '', 0, false, NaN, null, undefined], | ||
generator = (function () { | ||
try { | ||
/*jshint evil:true */ | ||
return new Function('return function*(){}'); | ||
} catch (ignore) {} | ||
}()), | ||
expected = falsey.map(function (value) { | ||
return value === ''; | ||
}), | ||
actual = falsey.map(function (value, index) { | ||
return index ? isArrayLike(value) : isArrayLike(); | ||
}); | ||
/* jshint elision:true */ | ||
var falsey = [, '', 0, false, NaN, null, undefined]; | ||
var generator = (function () { | ||
try { | ||
/* jshint evil:true */ | ||
return new Function('return function*(){}'); | ||
} catch (ignore) { | ||
return void 0; | ||
} | ||
}()); | ||
var expected = falsey.map(function (value) { | ||
return value === ''; | ||
}); | ||
var actual = falsey.map(function (value, index) { | ||
return index ? isArrayLike(value) : isArrayLike(); | ||
}); | ||
expect(actual).toEqual(expected); | ||
@@ -65,24 +78,21 @@ expect(isArrayLike(true)).toBe(false); | ||
expect(isArrayLike(Array.prototype.slice)).toBe(false); | ||
expect(isArrayLike({ 'a': 1 })).toBe(false); | ||
expect(isArrayLike({ a: 1 })).toBe(false); | ||
expect(isArrayLike(1)).toBe(false); | ||
expect(isArrayLike(/x/)).toBe(false); | ||
var fat; | ||
try { | ||
/*jshint evil:true */ | ||
fat = new Function('return () => {return this;}'); | ||
/* jshint evil:true */ | ||
var fat = new Function('return () => {return this;}'); | ||
expect(isArrayLike(fat)).toBe(false); | ||
} catch (ignore) {} | ||
var gen; | ||
try { | ||
/*jshint evil:true */ | ||
gen = new Function('return function* idMaker(){}'); | ||
/* jshint evil:true */ | ||
var gen = new Function('return function* idMaker(){}'); | ||
expect(isArrayLike(gen)).toBe(false); | ||
} catch (ignore) {} | ||
var classes; | ||
try { | ||
/*jshint evil:true */ | ||
classes = new Function('"use strict"; return class MyClass {}'); | ||
/* jshint evil:true */ | ||
var classes = new Function('"use strict"; return class MyClass {}'); | ||
expect(isArrayLike(classes)).toBe(false); | ||
@@ -89,0 +99,0 @@ } catch (ignore) {} |
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
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
153962
14
957
70
14
Updatedis-function-x@^1.1.0
Updatedis-nil-x@^1.1.0
Updatedlodash.islength@^4.0.1