@sindresorhus/is
Advanced tools
Comparing version 4.3.0 to 4.4.0
/// <reference types="node" /> | ||
/// <reference lib="es2018" /> | ||
/// <reference lib="dom" /> | ||
import { Class, TypedArray, ObservableLike, Primitive } from './types'; | ||
import { Class, Falsy, TypedArray, ObservableLike, Primitive } from './types'; | ||
declare const objectTypeNames: readonly ["Function", "Generator", "AsyncGenerator", "GeneratorFunction", "AsyncGeneratorFunction", "AsyncFunction", "Observable", "Array", "Buffer", "Object", "RegExp", "Date", "Error", "Map", "Set", "WeakMap", "WeakSet", "ArrayBuffer", "SharedArrayBuffer", "DataView", "Promise", "URL", "FormData", "URLSearchParams", "HTMLElement", ...("Int8Array" | "Uint8Array" | "Uint8ClampedArray" | "Int16Array" | "Uint16Array" | "Int32Array" | "Uint32Array" | "Float32Array" | "Float64Array" | "BigInt64Array" | "BigUint64Array")[]]; | ||
@@ -61,4 +61,4 @@ declare type ObjectTypeName = typeof objectTypeNames[number]; | ||
var urlString: (value: unknown) => value is string; | ||
var truthy: (value: unknown) => boolean; | ||
var falsy: (value: unknown) => boolean; | ||
var truthy: <T>(value: false | "" | 0 | 0n | T | null | undefined) => value is T; | ||
var falsy: <T>(value: false | "" | 0 | 0n | T | null | undefined) => value is Falsy; | ||
var nan: (value: unknown) => boolean; | ||
@@ -65,0 +65,0 @@ var primitive: (value: unknown) => value is Primitive; |
@@ -196,3 +196,2 @@ "use strict"; | ||
}; | ||
// TODO: Use the `not` operator with a type guard here when it's available. | ||
// Example: `is.truthy = (value: unknown): value is (not false | not 0 | not '' | not undefined | not null) => Boolean(value);` | ||
@@ -199,0 +198,0 @@ is.truthy = (value) => Boolean(value); |
@@ -25,1 +25,2 @@ /** | ||
} | ||
export declare type Falsy = false | 0 | 0n | '' | null | undefined; |
{ | ||
"name": "@sindresorhus/is", | ||
"version": "4.3.0", | ||
"version": "4.4.0", | ||
"description": "Type check values", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -217,6 +217,4 @@ # is | ||
**TypeScript-only** | ||
TypeScript-only. Returns `true` if `value` is a member of `enum`. | ||
Returns `true` if `value` is a member of `enum`. | ||
```ts | ||
@@ -223,0 +221,0 @@ enum Direction { |
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
56046
650