package/package.json000644 001750 001750 0000003034 12317616752013031 0ustar00000000 000000 { "name": "x-is-array", "version": "0.1.0", "description": "Simple array test", "keywords": [], "author": "Matt-Esch ", "repository": "git://github.com/Matt-Esch/x-is-array.git", "main": "index", "homepage": "https://github.com/Matt-Esch/x-is-array", "contributors": [ { "name": "Matt-Esch" } ], "bugs": { "url": "https://github.com/Matt-Esch/x-is-array/issues", "email": "matt@mattesch.info" }, "dependencies": {}, "devDependencies": { "latest": "^0.1.2", "tape": "^2.12.2" }, "licenses": [ { "type": "MIT", "url": "http://github.com/Matt-Esch/x-is-array/raw/master/LICENSE" } ], "scripts": { "test": "node ./test/index.js", "start": "node ./index.js", "watch": "nodemon -w ./index.js index.js", "travis-test": "istanbul cover ./test/index.js && ((cat coverage/lcov.info | coveralls) || exit 0)", "cover": "istanbul cover --report none --print detail ./test/index.js", "view-cover": "istanbul report html && google-chrome ./coverage/index.html", "test-browser": "testem-browser ./test/browser/index.js", "testem": "testem-both -b=./test/browser/index.js" }, "testling": { "files": "test/index.js", "browsers": [ "ie/8..latest", "firefox/16..latest", "firefox/nightly", "chrome/22..latest", "chrome/canary", "opera/12..latest", "opera/next", "safari/5.1..latest", "ipad/6.0..latest", "iphone/6.0..latest", "android-browser/4.2..latest" ] } } package/.npmignore000644 001750 001750 0000000235 12317616636012543 0ustar00000000 000000 .DS_Store .monitor .*.swp .nodemonignore releases *.log *.err fleet.json public/browserify bin/*.json .bin build compile .lock-wscript coverage node_modules package/README.md000644 001750 001750 0000000652 12317620074012015 0ustar00000000 000000 # x-is-array Simple array test ## Example ```js var isArray = require("x-is-array") isArray([]) // -> true isArray("hello") // -> false isArray("") // -> false isArray(9) // -> false isArray(true) // -> false isArray(new Date()) // -> false isArray({ // -> false isArray(null) // -> false isArray(undefined) // -> false ``` ## Installation `npm install x-is-array` ## Contributors - Matt-Esch ## MIT Licencedpackage/LICENCE000644 001750 001750 0000002036 12317616636011532 0ustar00000000 000000 Copyright (c) 2014 Matt-Esch. 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. package/index.js000644 001750 001750 0000000304 12317616707012205 0ustar00000000 000000 var nativeIsArray = Array.isArray var toString = Object.prototype.toString module.exports = nativeIsArray || isArray function isArray(obj) { return toString.call(obj) === "[object Array]" } package/.travis.yml000644 001750 001750 0000000212 12317616636012650 0ustar00000000 000000 language: node_js node_js: - 0.8 - "0.10" before_script: - npm install - npm install istanbul coveralls script: npm run travis-test package/test/index.js000644 001750 001750 0000002170 12317617226013164 0ustar00000000 000000 var test = require("tape") var isArray = require("../index") test("isArray is a function", function (assert) { assert.equal(typeof isArray, "function") assert.end() }) test("array literal is truthy", function (assert) { assert.equal(isArray([]), true) assert.end() }) test("string literal is false", function (assert) { assert.equal(isArray("hello"), false) assert.end() }) test("empty string is false", function (assert) { assert.equal(isArray(""), false) assert.end() }) test("number is falsey", function (assert) { assert.equal(isArray(9), false) assert.end() }) test("boolean is falsey", function (assert) { assert.equal(isArray(true), false) assert.end() }) test("date is falsey", function (assert) { assert.equal(isArray(new Date()), false) assert.end() }) test("object is falsey", function (assert) { assert.equal(isArray({}), false) assert.end() }) test("null is falsey", function (assert) { assert.equal(isArray(null), false) assert.end() }) test("undefined is falsey", function (assert) { assert.equal(isArray(undefined), false) assert.end() })