@sindresorhus/is
Advanced tools
Comparing version 0.17.1 to 1.0.0
@@ -6,3 +6,2 @@ "use strict"; | ||
// 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; | ||
@@ -65,3 +64,4 @@ const { toString } = Object.prototype; | ||
is.string = isOfType('string'); | ||
is.number = isOfType('number'); | ||
const isNumberType = isOfType('number'); | ||
is.number = (value) => isNumberType(value) && !is.nan(value); | ||
is.bigint = isOfType('bigint'); | ||
@@ -80,3 +80,2 @@ // eslint-disable-next-line @typescript-eslint/ban-types | ||
is.iterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.iterator]); | ||
// eslint-disable-next-line no-use-extend-native/no-use-extend-native | ||
is.asyncIterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.asyncIterator]); | ||
@@ -83,0 +82,0 @@ is.generator = (value) => is.iterable(value) && is.function_(value.next) && is.function_(value.throw); |
{ | ||
"name": "@sindresorhus/is", | ||
"version": "0.17.1", | ||
"version": "1.0.0", | ||
"description": "Type check values", | ||
@@ -49,14 +49,15 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@sindresorhus/tsconfig": "^0.3.0", | ||
"@types/jsdom": "^12.2.3", | ||
"@types/node": "^12.0.0", | ||
"@sindresorhus/tsconfig": "^0.4.0", | ||
"@types/jsdom": "^12.2.4", | ||
"@types/node": "^12.0.10", | ||
"@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/eslint-plugin": "^1.11.0", | ||
"@typescript-eslint/parser": "^1.11.0", | ||
"ava": "^2.1.0", | ||
"del-cli": "^2.0.0", | ||
"eslint-config-xo-typescript": "^0.15.0", | ||
"jsdom": "^15.0.0", | ||
"rxjs": "^6.4.0", | ||
"tempy": "^0.3.0", | ||
"ts-node": "^8.0.3", | ||
"ts-node": "^8.3.0", | ||
"typescript": "^3.4.1", | ||
@@ -89,2 +90,6 @@ "xo": "^0.24.0", | ||
"rules": { | ||
"import/first": "off", | ||
"import/newline-after-import": "off", | ||
"@typescript-eslint/promise-function-async": "off", | ||
"@typescript-eslint/no-empty-function": "off", | ||
"@typescript-eslint/explicit-function-return-type": "off" | ||
@@ -91,0 +96,0 @@ } |
@@ -71,2 +71,5 @@ # is [![Build Status](https://travis-ci.org/sindresorhus/is.svg?branch=master)](https://travis-ci.org/sindresorhus/is) | ||
##### .number(value) | ||
Note: `is.number(NaN)` returns `false`. This intentionally deviates from `typeof` behavior to increase user-friendliness of `is` type checks. | ||
##### .boolean(value) | ||
@@ -87,3 +90,3 @@ ##### .symbol(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'`. | ||
@@ -460,3 +463,3 @@ Note: `'NaN'` returns `false`, but `'Infinity'` and `'-Infinity'` return `true`. | ||
## Created by | ||
## Maintainers | ||
@@ -466,6 +469,1 @@ - [Sindre Sorhus](https://github.com/sindresorhus) | ||
- [Brandon Smith](https://github.com/brandon93s) | ||
## License | ||
MIT |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
43168
1
16
395
466