typebad 1.0.0 → 1.0.1
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/dist/cjs/Type.d.ts +2 -2
- package/dist/esm/Type.d.ts +2 -2
- package/package.json +1 -1
package/dist/cjs/Type.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type InputType<T> = T extends Type<infer U> ? U : never;
|
|
2
|
-
type InputSchema<T extends TypeSchema> = Simplify<{
|
|
2
|
+
export type InputSchema<T extends TypeSchema> = Simplify<{
|
|
3
3
|
[K in keyof T as undefined extends InputType<T[K]> ? never : unknown extends InputType<T[K]> ? never : K]: InputType<T[K]>;
|
|
4
4
|
} & {
|
|
5
5
|
[K in keyof T as undefined extends InputType<T[K]> ? unknown extends InputType<T[K]> ? never : K : never]?: InputType<T[K]>;
|
|
@@ -9,7 +9,7 @@ type Simplify<T> = {
|
|
|
9
9
|
} & {};
|
|
10
10
|
export type TypeSchema = Record<string, Type<any>>;
|
|
11
11
|
type IsTuple<T> = T extends readonly any[] ? number extends T["length"] ? false : true : false;
|
|
12
|
-
type OutputValue<T> = T extends undefined ? OutputValue<Exclude<T, undefined>> : T extends Date ? Date : IsTuple<T> extends true ? {
|
|
12
|
+
export type OutputValue<T> = T extends undefined ? OutputValue<Exclude<T, undefined>> : T extends Date ? Date : IsTuple<T> extends true ? {
|
|
13
13
|
[K in keyof T]: OutputValue<T[K]>;
|
|
14
14
|
} : T extends (infer U)[] ? OutputValue<U>[] : T extends Record<string, any> ? {
|
|
15
15
|
[K in keyof T]-?: OutputValue<T[K]>;
|
package/dist/esm/Type.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type InputType<T> = T extends Type<infer U> ? U : never;
|
|
2
|
-
type InputSchema<T extends TypeSchema> = Simplify<{
|
|
2
|
+
export type InputSchema<T extends TypeSchema> = Simplify<{
|
|
3
3
|
[K in keyof T as undefined extends InputType<T[K]> ? never : unknown extends InputType<T[K]> ? never : K]: InputType<T[K]>;
|
|
4
4
|
} & {
|
|
5
5
|
[K in keyof T as undefined extends InputType<T[K]> ? unknown extends InputType<T[K]> ? never : K : never]?: InputType<T[K]>;
|
|
@@ -9,7 +9,7 @@ type Simplify<T> = {
|
|
|
9
9
|
} & {};
|
|
10
10
|
export type TypeSchema = Record<string, Type<any>>;
|
|
11
11
|
type IsTuple<T> = T extends readonly any[] ? number extends T["length"] ? false : true : false;
|
|
12
|
-
type OutputValue<T> = T extends undefined ? OutputValue<Exclude<T, undefined>> : T extends Date ? Date : IsTuple<T> extends true ? {
|
|
12
|
+
export type OutputValue<T> = T extends undefined ? OutputValue<Exclude<T, undefined>> : T extends Date ? Date : IsTuple<T> extends true ? {
|
|
13
13
|
[K in keyof T]: OutputValue<T[K]>;
|
|
14
14
|
} : T extends (infer U)[] ? OutputValue<U>[] : T extends Record<string, any> ? {
|
|
15
15
|
[K in keyof T]-?: OutputValue<T[K]>;
|