[Pkg-javascript-commits] [node-isarray] 01/05: Imported Upstream version 1.0.0
Ross Gammon
ross-guest at moszumanska.debian.org
Tue Dec 29 19:14:25 UTC 2015
This is an automated email from the git hooks/post-receive script.
ross-guest pushed a commit to branch master
in repository node-isarray.
commit 6bccd556917f51e6f56519d35898761bb0397fed
Author: Ross Gammon <rossgammon at mail.dk>
Date: Tue Dec 29 17:40:57 2015 +0100
Imported Upstream version 1.0.0
---
.gitignore | 1 +
.travis.yml | 4 ++++
Makefile | 6 ++++++
README.md | 6 ++++++
index.js | 4 +++-
package.json | 50 +++++++++++++++++++++++++++++++++++---------------
test.js | 20 ++++++++++++++++++++
7 files changed, 75 insertions(+), 16 deletions(-)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3c3629e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+node_modules
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..cc4dba2
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+ - "0.8"
+ - "0.10"
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..787d56e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,6 @@
+
+test:
+ @node_modules/.bin/tape test.js
+
+.PHONY: test
+
diff --git a/README.md b/README.md
index 052a62b..16d2c59 100644
--- a/README.md
+++ b/README.md
@@ -3,6 +3,12 @@
`Array#isArray` for older browsers.
+[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray)
+[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray)
+
+[![browser support](https://ci.testling.com/juliangruber/isarray.png)
+](https://ci.testling.com/juliangruber/isarray)
+
## Usage
```js
diff --git a/index.js b/index.js
index 5f5ad45..a57f634 100644
--- a/index.js
+++ b/index.js
@@ -1,3 +1,5 @@
+var toString = {}.toString;
+
module.exports = Array.isArray || function (arr) {
- return Object.prototype.toString.call(arr) == '[object Array]';
+ return toString.call(arr) == '[object Array]';
};
diff --git a/package.json b/package.json
index 5a1e9c1..1a4317a 100644
--- a/package.json
+++ b/package.json
@@ -1,25 +1,45 @@
{
- "name" : "isarray",
- "description" : "Array#isArray for older browsers",
- "version" : "0.0.1",
- "repository" : {
- "type" : "git",
- "url" : "git://github.com/juliangruber/isarray.git"
+ "name": "isarray",
+ "description": "Array#isArray for older browsers",
+ "version": "1.0.0",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/juliangruber/isarray.git"
},
"homepage": "https://github.com/juliangruber/isarray",
- "main" : "index.js",
- "scripts" : {
- "test" : "tap test/*.js"
+ "main": "index.js",
+ "dependencies": {},
+ "devDependencies": {
+ "tape": "~2.13.4"
},
- "dependencies" : {},
- "devDependencies" : {
- "tap" : "*"
- },
- "keywords": ["browser","isarray","array"],
+ "keywords": [
+ "browser",
+ "isarray",
+ "array"
+ ],
"author": {
"name": "Julian Gruber",
"email": "mail at juliangruber.com",
"url": "http://juliangruber.com"
},
- "license": "MIT"
+ "license": "MIT",
+ "testling": {
+ "files": "test.js",
+ "browsers": [
+ "ie/8..latest",
+ "firefox/17..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"
+ ]
+ },
+ "scripts": {
+ "test": "tape test.js"
+ }
}
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..e0c3444
--- /dev/null
+++ b/test.js
@@ -0,0 +1,20 @@
+var isArray = require('./');
+var test = require('tape');
+
+test('is array', function(t){
+ t.ok(isArray([]));
+ t.notOk(isArray({}));
+ t.notOk(isArray(null));
+ t.notOk(isArray(false));
+
+ var obj = {};
+ obj[0] = true;
+ t.notOk(isArray(obj));
+
+ var arr = [];
+ arr.foo = 'bar';
+ t.ok(isArray(arr));
+
+ t.end();
+});
+
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-isarray.git
More information about the Pkg-javascript-commits
mailing list