Repository: sindresorhus/is (ts)

Issue:
Any value in `is.numericValue` or similar?
At the moment, `is.number` returns `true` if the passed value is `NaN`. I'd quite like a function that returned `true` iff the passed value was a number with a real numeric value (`0`, `-0`, `+0`, etc. still count, `Infinity` I'd take either way (arguably `true` as Infinity is a real numeric value, just not actually countable)).

Not having yet thought about any edge cases, I imagine this would be a simple function:

```js
export const numericValue = (value) => number(value) && ! nan(value)
```

Pull request description:
Make `is.number(NaN)` return false
Fixes #63 

> I'm been thinking about this a lot, and I'm now leaning towards just changing `is.number()` to not accept `NaN`. It can work if we clearly document that it does not accept `NaN`. Just because `typeof` is broken, doesn't mean that we can't do better. This package is all about creating the most user-friendly type checks.

And so, `is.number(NaN)` returns `false`. No further changes, so `-Infinite` and `Infinite` and `-0` still return `true`.

Patch:
diff --git a/package.json b/package.json
index 90625cc..dcc997d 100644
--- a/package.json
+++ b/package.json
@@ -46,14 +46,15 @@
 		"types"
 	],
 	"devDependencies": {
-		"@sindresorhus/tsconfig": "^0.3.0",
+		"@sindresorhus/tsconfig": "^0.4.0",
 		"@types/jsdom": "^12.2.3",
 		"@types/node": "^12.0.0",
 		"@types/zen-observable": "^0.8.0",
 		"@typescript-eslint/eslint-plugin": "^1.5.0",
-		"ava": "^1.4.1",
-		"del-cli": "^1.1.0",
-		"eslint-config-xo-typescript": "^0.10.1",
+		"@typescript-eslint/parser": "^1.10.2",
+		"ava": "^2.1.0",
+		"del-cli": "^2.0.0",
+		"eslint-config-xo-typescript": "^0.14.0",
 		"jsdom": "^15.0.0",
 		"rxjs": "^6.4.0",
 		"tempy": "^0.3.0",
@@ -85,6 +86,8 @@
 			"BigUint64Array"
 		],
 		"rules": {
+			"import/first": "off",
+			"import/newline-after-import": "off",
 			"@typescript-eslint/explicit-function-return-type": "off"
 		}
 	}
diff --git a/readme.md b/readme.md
index 5bfdd72..c3c5adb 100644
--- a/readme.md
+++ b/readme.md
@@ -68,6 +68,9 @@ All the below methods accept a value and returns a boolean for whether the value
 ##### .null(value)
 ##### .string(value)
 ##### .number(value)
+
+Note: `is.number(NaN)` returns `false`. This intentionally deviates from `typeof` behavior to increase user-friendliness of `is` type checks.
+
 ##### .boolean(value)
 ##### .symbol(value)
 ##### .bigint(value)
@@ -83,7 +86,7 @@ Keep in mind that [functions are objects too](https://developer.mozilla.org/en-U
 
 ##### .numericString(value)
 
-Returns `true` for a string that represents a number. For example, `'42'` and `'-8'`.
+Returns `true` for a string that represents a number satisfying `is.number`, for example, `'42'` and `'-8.3'`.
 
 Note: `'NaN'` returns `false`, but `'Infinity'` and `'-Infinity'` return `true`.
 
diff --git a/source/index.ts b/source/index.ts
index 4cd388d..33b7896 100644
--- a/source/index.ts
+++ b/source/index.ts
@@ -2,7 +2,6 @@
 /// <reference lib="dom"/>
 
 // TODO: Use the `URL` global when targeting Node.js 10
-// eslint-disable-next-line @typescript-eslint/no-require-imports
 const URLGlobal = typeof URL === 'undefined' ? require('url').URL : URL;
 
 export type Class<T = unknown> = new (...args: any[]) => T;
@@ -118,7 +117,10 @@ const isObject = (value: unknown): value is object => typeof value === 'object';
 
 is.undefined = isOfType<undefined>('undefined');
 is.string = isOfType<string>('string');
-is.number = isOfType<number>('number');
+
+const isNumberType = isOfType<number>('number');
+is.number = (value: unknown): value is number => isNumberType(value) && !is.nan(value);
+
 is.bigint = isOfType<bigint>('bigint');
 
 // eslint-disable-next-line @typescript-eslint/ban-types


Test patch:
diff --git a/test/test.ts b/test/test.ts
index ce01004..748ce7a 100644
--- a/test/test.ts
+++ b/test/test.ts
@@ -1,15 +1,14 @@
-import fs from 'fs';
-import net from 'net';
-import Stream from 'stream';
-import util from 'util';
-import tempy from 'tempy';
+import fs = require('fs');
+import net = require('net');
+import Stream = require('stream');
+import {inspect} from 'util';
+import tempy = require('tempy');
 import test, {ExecutionContext} from 'ava';
 import {JSDOM} from 'jsdom';
 import {Subject, Observable} from 'rxjs';
-import ZenObservable from 'zen-observable';
+import ZenObservable = require('zen-observable');
 import is, {TypeName} from '../source';
 
-// eslint-disable-next-line @typescript-eslint/no-require-imports
 const URLGlobal = typeof URL === 'undefined' ? require('url').URL : URL;
 
 const isNode10orHigher = Number(process.versions.node.split('.')[0]) >= 10;
@@ -472,7 +471,7 @@ const testType = (t: ExecutionContext, type: string, exclude?: string[]) => {
 		const assert = isTypeUnderTest ? t.true.bind(t) : t.false.bind(t);
 
 		for (const fixture of fixtures) {
-			assert(testIs(fixture), `Value: ${util.inspect(fixture)}`);
+			assert(testIs(fixture), `Value: ${inspect(fixture)}`);
 
 			if (isTypeUnderTest && typename) {
 				t.is(is(fixture), typename);
@@ -494,7 +493,7 @@ test('is.string', t => {
 });
 
 test('is.number', t => {
-	testType(t, 'number', ['nan', 'integer', 'safeInteger', 'infinite']);
+	testType(t, 'number', ['integer', 'safeInteger', 'infinite']);
 });
 
 // TODO: Nodejs 10 only