@package-json/types
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -428,2 +428,35 @@ /* eslint-disable */ | ||
/** | ||
* Skip evaluating `U` if `T` is `unknown`. | ||
*/ | ||
type EvalIfNotUnknown<T, U> = unknown extends T ? never : U; | ||
/** | ||
* Resolve mapped types and show the derived keys and their types when hovering in | ||
* VS Code, instead of just showing the names those mapped types are defined with. | ||
*/ | ||
type Prettify<T> = { | ||
[K in keyof T]: T[K]; | ||
} & {}; | ||
/** | ||
* Get the keys of T without any keys of U. | ||
*/ | ||
type Without<T, U> = { | ||
[P in Exclude<keyof T, keyof U>]?: never; | ||
}; | ||
/** | ||
* Restrict using either exclusively the keys of `T` or exclusively the keys of `U`. | ||
* | ||
* No unique keys of `T` can be used simultaneously with any unique keys of `U`. | ||
* | ||
* @example | ||
* ```ts | ||
* const myVar: XOR<{ data: object }, { error: object }> | ||
* ``` | ||
* | ||
* Supports from 2 up to 3 generic parameters. | ||
* | ||
* More: https://github.com/maninak/ts-xor/tree/master#description | ||
*/ | ||
type XOR<A, B, C = unknown> = Prettify<(A & Without<B & C, A>) | (B & Without<A & C, B>) | EvalIfNotUnknown<C, C & Without<A & B, C>>>; | ||
/** | ||
A mapping of conditions and the paths to which they resolve. | ||
@@ -437,3 +470,3 @@ */ | ||
*/ | ||
type Exports = Array<ExportConditions | string> | ExportConditions | null | string; | ||
type Exports = null | XOR<string, Array<ExportConditions | string>, ExportConditions>; | ||
@@ -440,0 +473,0 @@ type PackageJson = { |
{ | ||
"name": "@package-json/types", | ||
"type": "module", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "Auto-generated package.json types.", | ||
@@ -6,0 +6,0 @@ "author": "藍+85CD", |
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
17585
474