pax_global_header00006660000000000000000000000064130127421500014505gustar00rootroot0000000000000052 comment=524a7d9ccd6ddab8495d5eb4bf56d587dec22ffe node-is-arrayish-1.3.1/000077500000000000000000000000001301274215000146655ustar00rootroot00000000000000node-is-arrayish-1.3.1/.editorconfig000066400000000000000000000004101301274215000173350ustar00rootroot00000000000000root = true [*] indent_style = tab end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.coffee] indent_style = space [{package.json,*.yml}] indent_style = space indent_size = 2 [*.md] trim_trailing_whitespace = false node-is-arrayish-1.3.1/.gitignore000066400000000000000000000000631301274215000166540ustar00rootroot00000000000000*.sw[a-p] /node_modules/ npm-ignore.log /coverage/ node-is-arrayish-1.3.1/.istanbul.yml000066400000000000000000000000731301274215000173070ustar00rootroot00000000000000instrumentation: excludes: - test.js - test/**/* node-is-arrayish-1.3.1/.npmignore000066400000000000000000000000641301274215000166640ustar00rootroot00000000000000/coverage/ /test.js /test/ *.sw[a-p] /node_modules/ node-is-arrayish-1.3.1/.travis.yml000066400000000000000000000017471301274215000170070ustar00rootroot00000000000000language: node_js script: - node_modules/.bin/istanbul cover node_modules/.bin/_mocha -- --compilers coffee:coffee-script/register - cat coverage/lcov.info | node_modules/.bin/coveralls node_js: - "0.10" - "0.11" - "0.12" - 3 - 4 - 5 - 6 - 7 os: - linux notifications: slack: secure: oOt8QGzdrPDsTMcyahtIq5Q+0U1iwfgJgFCxBLsomQ0bpIMn+y5m4viJydA2UinHPGc944HS3LMZS9iKQyv+DjTgbhUyNXqeVjtxCwRe37f5rKQlXVvdfmjHk2kln4H8DcK3r5Qd/+2hd9BeMsp2GImTrkRSud1CZQlhhe5IgZOboSoWpGVMMy1iazWT06tAtiB2LRVhmsdUaFZDWAhGZ+UAvCPf+mnBOAylIj+U0GDrofhfTi25RK0gddG2f/p2M1HCu49O6wECGWkt2hVei233DkNJyLLLJVcvmhf+aXkV5TjMyaoxh/HdcV4DrA7KvYuWmWWKsINa9hlwAsdd/FYmJ6PjRkKWas2JoQ1C+qOzDxyQvn3CaUZFKD99pdsq0rBBZujqXQKZZ/hWb/CE74BI6fKmqQkiEPaD/7uADj04FEg6HVBZaMCyauOaK5b3VC97twbALZ1qVxYV6mU+zSEvnUbpnjjvRO0fSl9ZHA+rzkW73kX3GmHY0wAozEZbSy7QLuZlQ2QtHmBLr+APaGMdL1sFF9qFfzqKy0WDbSE0WS6hpAEJpTsjYmeBrnI8UmK3m++iEgyQPvZoH9LhUT+ek7XIfHZMe04BmC6wuO24/RfpmR6bQK9VMarFCYlBiWxg/z30vkP0KTpUi3o/cqFm7/Noxc0i2LVqM3E0Sy4= node-is-arrayish-1.3.1/LICENSE000066400000000000000000000020651301274215000156750ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) 2015 JD Ballard Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. node-is-arrayish-1.3.1/README.md000066400000000000000000000013001301274215000161360ustar00rootroot00000000000000# node-is-arrayish [![Travis-CI.org Build Status](https://img.shields.io/travis/Qix-/node-is-arrayish.svg?style=flat-square)](https://travis-ci.org/Qix-/node-is-arrayish) [![Coveralls.io Coverage Rating](https://img.shields.io/coveralls/Qix-/node-is-arrayish.svg?style=flat-square)](https://coveralls.io/r/Qix-/node-is-arrayish) > Determines if an object can be used like an Array ## Example ```javascript var isArrayish = require('is-arrayish'); isArrayish([]); // true isArrayish({__proto__: []}); // true isArrayish({}); // false isArrayish({length:10}); // false ``` ## License Licensed under the [MIT License](http://opensource.org/licenses/MIT). You can find a copy of it in [LICENSE](LICENSE). node-is-arrayish-1.3.1/index.js000066400000000000000000000005151301274215000163330ustar00rootroot00000000000000'use strict'; module.exports = function isArrayish(obj) { if (!obj || typeof obj === 'string') { return false; } return obj instanceof Array || Array.isArray(obj) || (obj.length >= 0 && (obj.splice instanceof Function || (Object.getOwnPropertyDescriptor(obj, (obj.length - 1)) && obj.constructor.name !== 'String'))); }; node-is-arrayish-1.3.1/package.json000066400000000000000000000013011301274215000171460ustar00rootroot00000000000000{ "name": "is-arrayish", "description": "Determines if an object can be used as an array", "version": "0.3.1", "author": "Qix (http://github.com/qix-)", "keywords": [ "is", "array", "duck", "type", "arrayish", "similar", "proto", "prototype", "type" ], "license": "MIT", "scripts": { "pretest": "xo", "test": "mocha --compilers coffee:coffee-script/register" }, "repository": { "type": "git", "url": "https://github.com/qix-/node-is-arrayish.git" }, "devDependencies": { "coffee-script": "^1.9.3", "coveralls": "^2.11.2", "istanbul": "^0.3.17", "mocha": "^2.2.5", "should": "^7.0.1", "xo": "^0.6.1" } } node-is-arrayish-1.3.1/test/000077500000000000000000000000001301274215000156445ustar00rootroot00000000000000node-is-arrayish-1.3.1/test/test.coffee000066400000000000000000000014301301274215000177720ustar00rootroot00000000000000should = require 'should' isArrayish = require '../' Error.stackTraceLimit = Infinity it 'should check if things are like arrays', -> (isArrayish 1).should.equal no (isArrayish 'hello').should.equal no (isArrayish {}).should.equal no (isArrayish null).should.equal no (isArrayish undefined).should.equal no (isArrayish length: 123, splice: (->)).should.equal yes (isArrayish length: 3, 0: 1, 1: 15, 2: 17).should.equal yes (isArrayish []).should.equal yes (isArrayish __proto__: []).should.equal yes (isArrayish __proto__: Array.prototype).should.equal yes if Object.setPrototypeOf (isArrayish Object.setPrototypeOf {}, []).should.equal yes (isArrayish Object.setPrototypeOf {}, Array.prototype).should.equal yes (isArrayish [1, 3, 4, 5]).should.equal yes