@peersyst/react-types
Advanced tools
Comparing version 1.5.3 to 1.5.4
@@ -24,10 +24,6 @@ import { CSSProperties, ReactElement } from "react"; | ||
*/ | ||
export type OverridableStringUnion< | ||
T extends string | number, | ||
U = Record<string, any>, | ||
> = GenerateStringUnion<Overwrite<Record<T, true>, U>>; | ||
export type OverridableStringUnion< | ||
T extends string | number, | ||
U = Record<string, any>, | ||
> = GenerateStringUnion<Overwrite<Record<T, true>, U>>; | ||
export type OverridableStringUnion<T extends string | number, U = Record<string, any>> = | ||
GenerateStringUnion<Overwrite<Record<T, true>, U>>; | ||
export type OverridableStringUnion<T extends string | number, U = Record<string, any>> = | ||
GenerateStringUnion<Overwrite<Record<T, true>, U>>; | ||
@@ -143,22 +139,18 @@ /** | ||
type FlattenedNestedKeys<T extends object> = FlattenedCoreNestedKeys<T>; | ||
type FlattenedCoreNestedKeys< | ||
T extends object, | ||
I extends number = MaxRecursiveIterations, | ||
> = I extends 0 | ||
? never | ||
: { | ||
[Key in keyof T]: T[Key] extends object | ||
? `${Key}.${CoreNestedKeys<T[Key], Iterations[I]>}` | ||
: Key; | ||
}[Extract<keyof T, string>]; | ||
type FlattenedCoreNestedKeys< | ||
T extends object, | ||
I extends number = MaxRecursiveIterations, | ||
> = I extends 0 | ||
? never | ||
: { | ||
[Key in keyof T]: T[Key] extends object | ||
? `${Key}.${CoreNestedKeys<T[Key], Iterations[I]>}` | ||
: Key; | ||
}[Extract<keyof T, string>]; | ||
type FlattenedCoreNestedKeys<T extends object, I extends number = MaxRecursiveIterations> = | ||
I extends 0 | ||
? never | ||
: { | ||
[Key in keyof T]: T[Key] extends object | ||
? `${Key}.${CoreNestedKeys<T[Key], Iterations[I]>}` | ||
: Key; | ||
}[Extract<keyof T, string>]; | ||
type FlattenedCoreNestedKeys<T extends object, I extends number = MaxRecursiveIterations> = | ||
I extends 0 | ||
? never | ||
: { | ||
[Key in keyof T]: T[Key] extends object | ||
? `${Key}.${CoreNestedKeys<T[Key], Iterations[I]>}` | ||
: Key; | ||
}[Extract<keyof T, string>]; | ||
@@ -169,20 +161,14 @@ /** | ||
type DeepPick<T extends object, K extends NestedKeys<T>> = CoreDeepPick<T, K>; | ||
type CoreDeepPick< | ||
T extends object, | ||
K extends string, | ||
I extends number = MaxRecursiveIterations, | ||
> = I extends 0 | ||
? never | ||
: K extends `${infer FirstKey}.${infer RestKey}` | ||
? CoreDeepPick<T[FirstKey], RestKey, Iterations[I]> | ||
: T[K]; | ||
type CoreDeepPick< | ||
T extends object, | ||
K extends string, | ||
I extends number = MaxRecursiveIterations, | ||
> = I extends 0 | ||
? never | ||
: K extends `${infer FirstKey}.${infer RestKey}` | ||
? CoreDeepPick<T[FirstKey], RestKey, Iterations[I]> | ||
: T[K]; | ||
type CoreDeepPick<T extends object, K extends string, I extends number = MaxRecursiveIterations> = | ||
I extends 0 | ||
? never | ||
: K extends `${infer FirstKey}.${infer RestKey}` | ||
? CoreDeepPick<T[FirstKey], RestKey, Iterations[I]> | ||
: T[K]; | ||
type CoreDeepPick<T extends object, K extends string, I extends number = MaxRecursiveIterations> = | ||
I extends 0 | ||
? never | ||
: K extends `${infer FirstKey}.${infer RestKey}` | ||
? CoreDeepPick<T[FirstKey], RestKey, Iterations[I]> | ||
: T[K]; | ||
@@ -194,1 +180,7 @@ /** | ||
export type UpdaterFn<T> = (updaterOrValue: Updater<T>) => void; | ||
/** | ||
* Replaces all occurrences of S in T with D | ||
*/ | ||
export type Replace<T extends string, S extends string, D extends string, A extends string = ""> = | ||
T extends `${infer L}${S}${infer R}` ? Replace<R, S, D, `${A}${L}${D}`> : `${A}${T}`; |
{ | ||
"name": "@peersyst/react-types", | ||
"author": "Peersyst", | ||
"version": "1.5.3", | ||
"version": "1.5.4", | ||
"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
7211
159