@waiting/shared-types
Advanced tools
Comparing version 4.5.0 to 4.6.0
@@ -6,2 +6,14 @@ # Change Log | ||
# [4.6.0](https://github.com/waitingsong/shared-types/compare/v4.5.0...v4.6.0) (2020-07-10) | ||
### Features | ||
* **types:** add type EqualsExt<> ([6917f32](https://github.com/waitingsong/shared-types/commit/6917f32951bc4945a4f1df0bc778f758265245cc)) | ||
* **types:** add type FormatIntersect<> ([1b0a92b](https://github.com/waitingsong/shared-types/commit/1b0a92b1c8eaacc33c81c0cf10a0fc409aaf0bb7)) | ||
# [4.5.0](https://github.com/waitingsong/shared-types/compare/v4.4.0...v4.5.0) (2020-06-30) | ||
@@ -8,0 +20,0 @@ |
@@ -5,3 +5,3 @@ /** | ||
* | ||
* @version 4.4.0 | ||
* @version 4.5.0 | ||
* @author waiting | ||
@@ -8,0 +8,0 @@ * @license MIT |
@@ -78,5 +78,20 @@ /** | ||
export declare type Equals<X, Y> = (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? true : false; | ||
/** | ||
* (Experimental) Equals two types which convert by FormatIntersect<> | ||
* ``` | ||
*/ | ||
export declare type EqualsExt<X, Y> = Equals<FormatIntersect<X>, FormatIntersect<Y>>; | ||
export declare type OverwriteNeverToUnknown<T extends any> = { | ||
[fld in keyof T]: T[fld] extends never ? unknown : T[fld]; | ||
}; | ||
/** | ||
* (Experimental) Rewrite members of intersect type into one type | ||
* | ||
* @example ```ts | ||
* {foo: number} & {bar: string} => {foo: number, bar: string} | ||
* ``` | ||
*/ | ||
export declare type FormatIntersect<T> = T extends object ? T extends any[] | number | string | boolean | Function ? T : { | ||
[K in keyof T]: T[K]; | ||
} : T; | ||
export {}; |
@@ -0,1 +1,2 @@ | ||
/* eslint-disable max-len */ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ |
{ | ||
"name": "@waiting/shared-types", | ||
"author": "waiting", | ||
"version": "4.5.0", | ||
"version": "4.6.0", | ||
"description": "shared typescript types", | ||
@@ -74,3 +74,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "10e73fbc02a033c1a72f809d3e9a8f1aad7eeea0" | ||
"gitHead": "dc59254601103d77edbb35c546d483fdbec99d54" | ||
} |
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
19697
296