@nu-art/ts-common 0.201.38 → 0.201.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/utils/types.d.ts +4 -1
package/package.json
CHANGED
package/utils/types.d.ts
CHANGED
|
@@ -148,6 +148,9 @@ export type MergeTypes<T extends unknown[]> = T extends [a: infer A, ...rest: in
|
|
|
148
148
|
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
|
149
149
|
export type NonEmptyArray<T> = [T, ...T[]];
|
|
150
150
|
export type AssetValueType<T, K extends keyof T, Ex> = T[K] extends Ex ? K : never;
|
|
151
|
+
export type RecursiveOmit<T, OmitKey extends keyof any> = {
|
|
152
|
+
[K in Exclude<keyof T, OmitKey>]: T[K] extends object ? RecursiveOmit<T[K], OmitKey> : T[K];
|
|
153
|
+
};
|
|
151
154
|
/**
|
|
152
155
|
* Constructs a union of string paths representing the properties and nested properties of an object type.
|
|
153
156
|
*
|
|
@@ -169,7 +172,7 @@ export type AssetValueType<T, K extends keyof T, Ex> = T[K] extends Ex ? K : nev
|
|
|
169
172
|
* type ProfilePaths = DotNotation<Profile>; // 'name' | 'contacts' | 'contacts.email' | 'contacts.email.primary' | 'contacts.email.secondary'
|
|
170
173
|
*/
|
|
171
174
|
export type DotNotation<T> = T extends object ? {
|
|
172
|
-
[K in keyof T]: K extends string ? `${K & string}` | `${K & string}.${DotNotation<T[K]>}` : never;
|
|
175
|
+
[K in keyof T]: K extends string ? T[K] extends object ? `${K & string}` | `${K & string}.${DotNotation<T[K]>}` : `${K & string}` : never;
|
|
173
176
|
}[keyof T] : '';
|
|
174
177
|
/**
|
|
175
178
|
* Replaces the type of nested property within an object, based on a specified path.
|