Comparing version 1.3.0 to 1.4.0
@@ -10,3 +10,3 @@ import {Builtin} from './common'; | ||
type _DeepPartial<T> = | ||
T extends Builtin ? Exclude<T, undefined> | ||
T extends Builtin ? T | ||
: T extends Promise<infer U> ? Promise<DeepPartial<U>> | ||
@@ -28,3 +28,3 @@ : T extends Map<infer K, infer V> ? Map<K, DeepPartial<V>> | ||
type _DeepBuildable<T> = | ||
T extends Builtin ? Exclude<T, undefined> | ||
T extends Builtin ? T | ||
: T extends Promise<infer U> ? Promise<DeepBuildable<U>> | ||
@@ -46,3 +46,3 @@ : T extends Map<infer K, infer V> ? Map<K, DeepBuildable<V>> | ||
type _DeepRequired<T> = | ||
T extends Builtin ? Exclude<T, undefined> | ||
T extends Builtin ? T | ||
: T extends Promise<infer U> ? Promise<DeepRequired<U>> | ||
@@ -65,3 +65,3 @@ : T extends Map<infer K, infer V> ? Map<K, DeepRequired<V>> | ||
type _DeepReadonly<T> = | ||
T extends Builtin ? Exclude<T, undefined> | ||
T extends Builtin ? T | ||
: T extends Promise<infer U> ? Promise<DeepReadonly<U>> | ||
@@ -83,3 +83,3 @@ : T extends Map<infer K, infer V> ? Map<K, DeepReadonly<V>> | ||
type _DeepWritable<T> = | ||
T extends Builtin ? Exclude<T, undefined> | ||
T extends Builtin ? T | ||
: T extends Promise<infer U> ? Promise<DeepWritable<U>> | ||
@@ -86,0 +86,0 @@ : T extends Map<infer K, infer V> ? Map<K, DeepWritable<V>> |
@@ -20,3 +20,3 @@ import {Builtin} from './common'; | ||
: T extends (infer U)[] ? DeepPickOptional<U>[] | ||
: { [P in K]: DeepPickOptional<Exclude<T[P], undefined>> }; | ||
: { [P in K]?: DeepPickOptional<T[P]> }; | ||
@@ -38,3 +38,3 @@ /** | ||
: T extends (infer U)[] ? DeepPickRequired<U>[] | ||
: { [P in J]: DeepPickRequired<Exclude<T[P], undefined>> }; | ||
: { [P in J]: DeepPickRequired<T[P]> }; | ||
@@ -56,3 +56,3 @@ /** | ||
: T extends (infer U)[] ? DeepPickReadonly<U>[] | ||
: { [P in J]: DeepPickReadonly<Exclude<T[P], undefined>> }; | ||
: { [P in J]: DeepPickReadonly<T[P]> }; | ||
@@ -74,3 +74,3 @@ /** | ||
: T extends (infer U)[] ? DeepPickWritable<U>[] | ||
: { [P in K]: DeepPickWritable<Exclude<T[P], undefined>> } | ||
: { [P in K]: DeepPickWritable<T[P]> } | ||
@@ -92,3 +92,3 @@ /** | ||
: T extends (infer U)[] ? DeepPickJson<U>[] | ||
: { [P in Keys]: DeepPickJson<Exclude<T[P], undefined>> }; | ||
: { [P in Keys]: DeepPickJson<T[P]> }; | ||
@@ -111,2 +111,2 @@ | ||
: T extends (infer U)[] ? DeepPickWritableJson<U>[] | ||
: { [P in Keys]: DeepPickWritableJson<Exclude<T[P], undefined>> }; | ||
: { [P in Keys]: DeepPickWritableJson<T[P]> }; |
@@ -72,9 +72,10 @@ import {Primitive, Type} from './common'; | ||
export type IfJson<T, Y = true, N = false> = | ||
IfNull<T> extends true ? Y : | ||
IfNever<T> extends true ? N : | ||
T extends Function ? N : | ||
T extends symbol ? N : | ||
IfUndefined<T> extends true ? N : | ||
T extends (infer U)[] ? IfJson<U> extends true ? Y : N | ||
: Y; | ||
IfAny<T> extends true ? Y : | ||
IfNull<T> extends true ? Y : | ||
IfNever<T> extends true ? N : | ||
T extends Function ? N : | ||
T extends symbol ? N : | ||
IfUndefined<T> extends true ? N : | ||
T extends (infer U)[] ? IfJson<U> extends true ? Y : N | ||
: Y; | ||
@@ -81,0 +82,0 @@ export type IfJsonOrAny<T, Y = true, N = false> = |
@@ -15,3 +15,3 @@ { | ||
], | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"types": "lib/index.d.ts", | ||
@@ -18,0 +18,0 @@ "repository": "git@github.com:panates/ts-gems.git", |
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
624
32309