expect-type
Advanced tools
Comparing version 0.14.2 to 0.15.0
@@ -64,3 +64,3 @@ export declare type Not<T extends boolean> = T extends true ? false : true; | ||
declare type ReadonlyEquivalent<X, Y> = Extends<(<T>() => T extends X ? true : false), (<T>() => T extends Y ? true : false)>; | ||
export declare type Extends<L, R> = IsNever<L> extends true ? IsNever<R> : L extends R ? true : false; | ||
export declare type Extends<L, R> = IsNever<L> extends true ? IsNever<R> : [L] extends [R] ? true : false; | ||
export declare type StrictExtends<L, R> = Extends<DeepBrand<L>, DeepBrand<R>>; | ||
@@ -67,0 +67,0 @@ export declare type Equal<Left, Right> = And<[StrictExtends<Left, Right>, StrictExtends<Right, Left>]>; |
{ | ||
"name": "expect-type", | ||
"version": "0.14.2", | ||
"version": "0.15.0", | ||
"keywords": [ | ||
@@ -31,2 +31,5 @@ "typescript", | ||
}, | ||
"np": { | ||
"cleanup": false | ||
}, | ||
"devDependencies": { | ||
@@ -37,2 +40,3 @@ "@types/jest": "29.0.0", | ||
"jest": "28.1.3", | ||
"np": "7.6.2", | ||
"ts-jest": "28.0.8", | ||
@@ -39,0 +43,0 @@ "typescript": "4.8.2" |
@@ -5,2 +5,3 @@ # expect-type | ||
[![](https://byob.yarr.is/mmkal/expect-type/coverage)](https://github.com/mmkal/expect-type/actions/workflows/ci.yml) | ||
![npm](https://img.shields.io/npm/dt/expect-type) | ||
@@ -180,2 +181,9 @@ Compile-time tests for types. Useful to make sure types don't regress into being overly-permissive as changes go in over time. | ||
Detect assignability of unioned types: | ||
```typescript | ||
expectTypeOf<number>().toMatchTypeOf<string | number>() | ||
expectTypeOf<string | number>().not.toMatchTypeOf<number>() | ||
``` | ||
Use `.extract` and `.exclude` to narrow down complex union types: | ||
@@ -182,0 +190,0 @@ |
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
35838
452
7