@inquirer/type
Advanced tools
Comparing version 1.2.2 to 1.3.0
@@ -17,1 +17,19 @@ /// <reference types="node" /> | ||
export type Prompt<Value, Config> = (config: Config, context?: Context) => CancelablePromise<Value>; | ||
/** | ||
* Utility types used for writing tests | ||
* | ||
* Equal<A, B> checks that A and B are the same type, and returns | ||
* either `true` or `false`. | ||
* | ||
* You can use it in combination with `Expect` to write type | ||
* inference unit tests: | ||
* | ||
* ```ts | ||
* type t = Expect< | ||
* Equal<Partial<{ a: string }>, { a?: string }> | ||
* > | ||
* ``` | ||
*/ | ||
export type Equal<X, Y> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2 ? true : false; | ||
export type Expect<T extends true> = T; | ||
export type Not<T extends boolean> = T extends true ? false : true; |
{ | ||
"name": "@inquirer/type", | ||
"version": "1.2.2", | ||
"version": "1.3.0", | ||
"description": "Inquirer core TS types", | ||
@@ -78,3 +78,3 @@ "main": "./dist/cjs/index.js", | ||
}, | ||
"gitHead": "6bfbdfc457ab6d99b9d80c106b5edad285c8b9ba" | ||
"gitHead": "bb5b6b857d227b0fe8fd55951784f03800cdf73c" | ||
} |
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
5740
67