@primitive/is-finite
v1.0.0
Published
Determine if a value is a finite `number`
Downloads
3
Readme
is-finite
Determine whether a JavaScript value is a finite number
.
Usage
import { expect } from "chai";
import isFinite from "@primitive/is-finite";
expect(isFinite(42)).to.be.true;
expect(isFinite(Number("1000"))).to.be.true;
expect(isFinite(undefined)).to.be.false;
expect(isFinite(null)).to.be.false;
expect(isFinite(Number.POSITIVE_INFINITY)).to.be.false;
expect(isFinite(Number.NEGATIVE_INFINITY)).to.be.false;
expect(isFinite(1 / 0))to.be.false;
expect(isFinite(0 / 0)).to.be.false;
Build & Test
This package uses Gulp for build automation, and Chai and Mocha for testing.
npm install # Installs dependencies.
npm run build # Build the project.
npm test # Run tests.
License
See the LICENSE
file for license information.