@peersyst/react-types
Advanced tools
Comparing version 1.3.1 to 1.3.2
# Versions | ||
## 1.2.3 | ||
[RecursivePartial] | ||
[RecursivePartialExcept] | ||
[Demand] | ||
[Loosen] | ||
[UndefinedKeys] | ||
[Defined] |
@@ -53,1 +53,39 @@ import { CSSProperties } from "react"; | ||
export type Difference<A, B> = Omit<A, keyof B>; | ||
/** | ||
* Makes all properties, included nested ones, partial | ||
*/ | ||
type RecursivePartial<T> = { | ||
[P in keyof T]?: T[P] extends (infer U)[] | ||
? RecursivePartial<U>[] | ||
: T[P] extends object | ||
? RecursivePartial<T[P]> | ||
: T[P]; | ||
}; | ||
/** | ||
* Makes all properties, included nested ones, partial. Except those of type K | ||
*/ | ||
type RecursivePartialExcept<T, K extends keyof T> = RecursivePartial<T> & Pick<T, K>; | ||
/** | ||
* Makes properties of type K required | ||
*/ | ||
type Demand<T, K extends keyof T> = T & { [P in K]-?: T[P] }; | ||
/** | ||
* Makes properties of type K optional | ||
*/ | ||
type Loosen<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>; | ||
/** | ||
* Gets all keys with type undefined of T | ||
*/ | ||
type UndefinedKeys<T> = { | ||
[K in keyof T]: T[K] extends undefined ? K : never; | ||
}[keyof T]; | ||
/** | ||
* Removes properties of type undefined from T | ||
*/ | ||
type Defined<T> = Omit<T, UndefinedKeys<T>>; |
{ | ||
"name": "@peersyst/react-types", | ||
"author": "Peersyst", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "types": "./index.d.ts", |
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
3993
77