[Pkg-javascript-commits] [node-is-finite] 01/03: Import Upstream version 1.0.2
Abhishek Lolage
abhisheklolage-guest at moszumanska.debian.org
Wed Feb 8 07:40:08 UTC 2017
This is an automated email from the git hooks/post-receive script.
abhisheklolage-guest pushed a commit to branch master
in repository node-is-finite.
commit 6a5f9e36b80ed091c12e949f1caf88491cc3dd4c
Author: Abhishek Lolage <abhisheklolage at gmail.com>
Date: Tue Jan 31 15:32:11 2017 +0000
Import Upstream version 1.0.2
---
.editorconfig | 16 ++++++++++++++++
.gitattributes | 1 +
.gitignore | 1 +
.jshintrc | 13 +++++++++++++
.travis.yml | 6 ++++++
index.js | 6 ++++++
license | 21 +++++++++++++++++++++
package.json | 36 ++++++++++++++++++++++++++++++++++++
readme.md | 28 ++++++++++++++++++++++++++++
test.js | 16 ++++++++++++++++
10 files changed, 144 insertions(+)
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..8311fe1
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,16 @@
+# editorconfig.org
+root = true
+
+[*]
+indent_style = tab
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[package.json]
+indent_style = space
+indent_size = 2
+
+[*.md]
+trim_trailing_whitespace = false
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..176a458
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+* text=auto
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/.jshintrc b/.jshintrc
new file mode 100644
index 0000000..804f8af
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,13 @@
+{
+ "node": true,
+ "esnext": true,
+ "bitwise": true,
+ "camelcase": true,
+ "curly": true,
+ "immed": true,
+ "newcap": true,
+ "noarg": true,
+ "undef": true,
+ "unused": "vars",
+ "strict": true
+}
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..dedfc07
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,6 @@
+sudo: false
+language: node_js
+node_js:
+ - 'iojs'
+ - '0.12'
+ - '0.10'
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..8067387
--- /dev/null
+++ b/index.js
@@ -0,0 +1,6 @@
+'use strict';
+var numberIsNan = require('number-is-nan');
+
+module.exports = Number.isFinite || function (val) {
+ return !(typeof val !== 'number' || numberIsNan(val) || val === Infinity || val === -Infinity);
+};
diff --git a/license b/license
new file mode 100644
index 0000000..654d0bf
--- /dev/null
+++ b/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus at gmail.com> (sindresorhus.com)
+
+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.
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..8d65d25
--- /dev/null
+++ b/package.json
@@ -0,0 +1,36 @@
+{
+ "name": "is-finite",
+ "version": "1.0.2",
+ "description": "ES2015 Number.isFinite() ponyfill",
+ "license": "MIT",
+ "repository": "sindresorhus/is-finite",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus at gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "ava"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "es2015",
+ "ponyfill",
+ "polyfill",
+ "shim",
+ "number",
+ "finite",
+ "is"
+ ],
+ "dependencies": {
+ "number-is-nan": "^1.0.0"
+ },
+ "devDependencies": {
+ "ava": "*"
+ }
+}
diff --git a/readme.md b/readme.md
new file mode 100644
index 0000000..567710c
--- /dev/null
+++ b/readme.md
@@ -0,0 +1,28 @@
+# is-finite [![Build Status](https://travis-ci.org/sindresorhus/is-finite.svg?branch=master)](https://travis-ci.org/sindresorhus/is-finite)
+
+> ES2015 [`Number.isFinite()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite) [ponyfill](https://ponyfill.com)
+
+
+## Install
+
+```sh
+$ npm install --save is-finite
+```
+
+
+## Usage
+
+```js
+var numIsFinite = require('is-finite');
+
+numIsFinite(4);
+//=> true
+
+numIsFinite(Infinity);
+//=> false
+```
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..bc43cb1
--- /dev/null
+++ b/test.js
@@ -0,0 +1,16 @@
+import test from 'ava';
+
+Number.isFinite = undefined;
+const m = require('./');
+
+test(t => {
+ t.true(m(0));
+ t.true(m(100));
+ t.true(m(-100));
+ t.true(m(4e44));
+ t.false(m('0'));
+ t.false(m(NaN));
+ t.false(m(undefined));
+ t.false(m(Infinity));
+ t.false(m(-Infinity));
+});
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-is-finite.git
More information about the Pkg-javascript-commits
mailing list