Comparing version 1.2.33 to 1.2.34
@@ -6,2 +6,24 @@ # Change Log | ||
## [1.2.34](https://github.com/bluelovers/ws-ts-type/compare/ts-type@1.2.33...ts-type@1.2.34) (2020-09-04) | ||
### ✨ Features | ||
* **deps:** move `ts-toolbelt` to peer deps ([3d4ef95](https://github.com/bluelovers/ws-ts-type/commit/3d4ef95424387ce68f3e45b35bb8921d5dfdecf5)) | ||
* get readonly keys of an Object. ([41de826](https://github.com/bluelovers/ws-ts-type/commit/41de826116a5fa5c911ac32d56e71ee140622bd4)) | ||
### 🚨 Tests | ||
* use `[@ts-expect-error](https://github.com/ts-expect-error)` ([c446116](https://github.com/bluelovers/ws-ts-type/commit/c446116adf132734fbacaf28ef8c47ca840f6ffb)) | ||
### BREAKING CHANGE | ||
* **deps:** `ts-toolbelt` is peer deps now | ||
## [1.2.33](https://github.com/bluelovers/ws-ts-type/compare/ts-type@1.2.32...ts-type@1.2.33) (2020-09-04) | ||
@@ -8,0 +30,0 @@ |
@@ -18,1 +18,29 @@ /** | ||
export declare type ITSKeyIsPartialOfRecord<T, K extends keyof T> = Omit<T, K> extends T ? K : never; | ||
/** | ||
* returns a union of the readonly keys of an Object. | ||
* | ||
* @see https://github.com/type-challenges/type-challenges/blob/master/questions/5-extreme-readonly-keys/README.md | ||
* @see https://github.com/type-challenges/type-challenges/issues/87 | ||
* | ||
* @alias ITSGetReadonlyKeys | ||
* | ||
* @example | ||
* interface Todo { | ||
* readonly title: string | ||
* readonly description: string | ||
* completed: boolean | ||
* } | ||
* type Keys = ITSKeyOfRecordExtractReadonly<Todo> | ||
* // expected to be "title" | "description" | ||
*/ | ||
export declare type ITSKeyOfRecordExtractReadonly<T> = { | ||
[K in keyof T]-?: (<U>() => U extends { | ||
-readonly [P in K]: T[K]; | ||
} ? 1 : 2) extends (<U>() => U extends { | ||
[P in K]: T[K]; | ||
} ? 1 : 2) ? never : K; | ||
}[keyof T]; | ||
export type { ITSKeyOfRecordExtractReadonly as ITSGetReadonlyKeys }; | ||
export declare type ITSKeyOfRecordExcludeReadonly<T> = Exclude<keyof T, ITSKeyOfRecordExtractReadonly<T>>; | ||
export declare type ITSKeyIsReadonlyOfRecord<T, K extends ITSKeyOfRecordExtractReadonly<T>> = Extract<K, ITSKeyOfRecordExtractReadonly<T>>; | ||
export declare type ITSKeyIsNotReadonlyOfRecord<T, K extends ITSKeyOfRecordExcludeReadonly<T>> = Extract<K, ITSKeyOfRecordExcludeReadonly<T>>; |
{ | ||
"name": "ts-type", | ||
"version": "1.2.33", | ||
"version": "1.2.34", | ||
"description": "add some typescript type and re-export some build-in typescript type", | ||
@@ -58,9 +58,9 @@ "keywords": [ | ||
"dependencies": { | ||
"ts-toolbelt": "^8.0.4", | ||
"typedarray-dts": "^1.0.0" | ||
}, | ||
"peerDependencies": { | ||
"@types/bluebird": "*" | ||
"@types/bluebird": "*", | ||
"ts-toolbelt": "^8.0.4" | ||
}, | ||
"gitHead": "9d59efd044f0518e59b9d8ee7f74ce4fdf1e6239" | ||
"gitHead": "b55c9cc11a3534d3fb66f7a262630ea4a7f43bfc" | ||
} |
@@ -129,2 +129,5 @@ # README | ||
- https://github.com/millsp/ts-toolbelt | ||
- https://github.com/type-challenges/type-challenges | ||
- https://github.com/andnp/SimplyTyped | ||
- https://github.com/piotrwitek/utility-types | ||
- |
Sorry, the diff of this file is not supported yet
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
368776
530
133
- Removedts-toolbelt@^8.0.4